Log In  
BBS > Lexaloffle Community Superblog
This is a combined feed of all Lexaloffle user blogs. For Lexaloffle-related news, see @zep's blog.

All | Following | PICO-8 | Voxatron | General :: [Thread List]

Cart #berzerk-0 | 2022-09-27 | Code ▽ | Embed ▽ | Forks ▽ | License: CC4-BY-NC-SA
2

My Pico-8 game inspired by the 1980 Stern Electronics game and made possible by the excellent "Speako8 Speech Synthesis Library" by Jennifer L Schmidt ( @bikibird) - https://www.lexaloffle.com/bbs/?pid=116919#p

How to Play

Shoot the robots. Avoid the walls. Don't stay in a room for too long!

Controls

[X] - Laser (stands still so you can accurate fire in one of 8 directions)
[O] - Laser (while running)

Thanks To

  • Finn for testing
  • Jennifer L Schmidt ( @bikibird) for creating Speako8

Version History

0.80 - 26-Sep-2022 - Released
0.81 - 27-Sep-2022 - Otto now destroys robots

P#118024 2022-09-27 04:44

Shovel Knight Main Theme

[sfx]
Here's my pico-8 transcription of the main theme from Shovel Knight :)

My pixel art skills aren't the most refined, so if anyone out there would like to take a stab at making a 128x128 title screen for this, I'll gladly use that to post this as a cart instead and credit you.

P#118011 2022-09-27 00:43

[sfx]

made with denote

P#118009 2022-09-26 23:42

Hello all! I'm having an issue with a game I'm developing, where the collision is working flawlessly with any side other than the left side. for some reason it just wont work with the warps in game and I'm not sure why. left side collisions are working everywhere else, namely with stopping the player walking thru the walls. but not for the warps in game, which are supposed to work kind of like Pokémon's teleporting system. Frankly, I'm stumped and would appreciate if someone could take a look at this. Linked are not only the relevant code in the game, but a test cartridge as well to see what the problem is.

the main files i believe the bug should be happening in is input.lua, collision.lua, and game_manager.lua

collision.lua

--collsion for the map
function collide_map(obj,aim,flag)
    --obj = table needs x,y,w,h
    --aim = left,right,up,down

    local x=obj.x  local y=obj.y
    local w=obj.w  local h=obj.h

    local x1=0   local y1=0
    local x2=0   local y2=0

    if aim=="left" then
      x1=x-1  y1=y
      x2=x    y2=y+h-1
    elseif aim=="right" then
      x1=x+w-1    y1=y
      x2=x+w  y2=y+h-1
    elseif aim=="up" then
      x1=x+2    y1=y-1
      x2=x+w-3  y2=y
    elseif aim=="down" then
      x1=x+2      y1=y+h
      x2=x+w-3    y2=y+h
    end

    --pixels to tiles
    x1/=8    y1/=8
    x2/=8    y2/=8

    if fget(mget(x1,y1), flag)
    or fget(mget(x1,y2), flag)
    or fget(mget(x2,y1), flag)
    or fget(mget(x2,y2), flag) then
      return true
    else
      return false
    end
end

game_manager.lua

--manages all overarching functions and mechanics
--ex: turns

--turn structure
turns = {
    turn = 0,
    moves = 4,
    actions = 2,
    end_moves = false,
    end_actions = false
}

--moves player with given direction
function move(dir)
    --if moving left and not colliding with walls
    if turns.moves > 0 and dir == "left" and not collide_map(p, dir, 1) then
        p.x -= 8
        turns.moves -= 1
        printh("col: "..tostring(collide_map(p, dir, 3)), "log", false)
        --check if colliding with left side warp !NOT WORKING!
        if collide_map(p, dir, 3) then
            -- move map
            printh("moving map left", "log", false)
            _map.last_x = _map.x
            _map.x -= 1
            printh("x:".._map.x, "log", false)
            p.x = 120
        end
    --if moving left and not colliding with walls    
    elseif turns.moves > 0 and dir == "right" and not collide_map(p, dir, 1) then
        p.x += 8
        turns.moves -= 1
        --check if colliding with right side warp !WORKING!
        if collide_map(p, dir, 3) then
            -- move map
            printh("moving map right", "log", false)
            _map.last_x = _map.x
            _map.x += 1
            printh("x:".._map.x, "log", false)
            p.x = 8
        end
    elseif turns.moves > 0 and dir == "up" and not collide_map(p, dir, 1) then
        p.y -= 8
        turns.moves -= 1
    elseif turns.moves > 0 and dir == "down" and not collide_map(p, dir, 1) then
        p.y += 8
        turns.moves -= 1
    else
        if turns.actions > 0 and turns.moves <= 0 then
            turns.end_moves = true
        elseif turns.actions <= 0 then
            turns.end_actions = true
        end
    end

end

function end_turn()
    turns.turn += 1
    turns.moves = 4
    turns.actions = 2
    turns.end_moves = false
    turns.end_actions = false
end

function draw_turns()
    if turns.end_moves then
        print("out of moves", 32, 0)
    elseif turns.end_actions then
        print("out of actions", 32, 0)
    end

    print("turn: "..turns.turn, 0, 0)
    print("moves: "..turns.moves, 0, 8)
    print("actions: "..turns.actions, 0, 16)
end

map.lua

-- map functionality, using the x and y in _map to determine which room the player is in

_map = {
    x = 0,
    y = 0,
    last_x = 0,
    last_y = 0
}

--draws the map
function draw_map()

    local x = 0 local y = 0

    if _map.x ~= 0 then
        x = (_map.x - _map.last_x)*(_map.x+15)
    end
    if _map.y ~= 0 then
        y = (_map.y - _map.last_x)*(_map.x+15)
    end

    printh("draw_x:"..x, "log", false)

    map(x, y)

end

input.lua

--input variables

input_frozen = false

--input function
--gets input for all buttons in the game and provides logic behind them
function input()
    if btnp(5) and not menu.menu_opened then
        open_menu()
    elseif btnp(5) and menu.menu_opened then
        close_menu()
    end
    if not input_frozen then
        if btnp(0) then
            move("left")
        end
        if btnp(1) then
            move("right")
        end
        if btnp(2) then
            move("up")
        end
        if btnp(3) then
            move("down")
        end
        if btnp(4) then
            end_turn()
        end
    end
end

player.lua

--player class, contains all information relavent to the player character

--structure containing all variables relevant to the player
p = {
    sp = 1,
    x = 64,
    y = 64,
    w = 8,
    h = 8
}

--draws the player to the screen
function draw_player()
    spr(p.sp, p.x, p.y)
end

menu.lua

--menu class containing all logic for the in game menu

--structure containing all variabkes relevant to the menu
menu = {
    menu_opened = false
}

--opens the menu
function open_menu()
    input_frozen = true
    menu.menu_opened = true
end

--closes the menu
function close_menu()
    input_frozen = false
    menu.menu_opened = false
end

-- draws the menu
function draw_menu()
    cls(0)
    map(112, 48)
    print("menu", 59, 6)
end

main.lua

--default functions draw, update, and init

function _init()
    --setting player
    p.sp = 1
    p.x = 64
    p.y = 64

    --resetting menu and input
    menu.menu_opened = false
    input_frozen = false
end

function _draw()

    if menu.menu_opened then
        draw_menu()
    elseif not menu.menu_opened then
        cls(3)
        draw_map()
        draw_player()
        draw_turns()
    end
end

function _update()
    input()
end

here is a test cartridge to see the issue at play

controls:
left: move left
right: move right
up: move up
down: move down

x: open menu
z: advance turn

to recreate the bug, you can walk through the warp on the right of the screen from spawn (orange arrows)
but when you make it to the other side, you cannot warp back even though the logic should let you.

Cart #fogijoyeso-0 | 2022-09-26 | Code ▽ | Embed ▽ | Forks ▽ | License: CC4-BY-NC-SA

thanks in advance for the help. I know the code is not as great as it could be, I'm relatively new to lua and pico-8 in general. thanks again!

P#117994 2022-09-26 18:44

Cart #ineedcoffee_pbesstudio-0 | 2022-09-26 | Code ▽ | Embed ▽ | Forks ▽ | License: CC4-BY-NC-SA
2

P#117978 2022-09-26 07:53

I'm working on a simple space invaders clone to teach a workshop this october.

This is what I've got:

INVADERS GAME:

Cart #invaderswip1-0 | 2022-09-26 | Code ▽ | Embed ▽ | Forks ▽ | No License
1

P#117971 2022-09-26 03:54

[sfx]

Here's a flute I made for a track in my current project. I tried to capture the breathy harmonics that happen on the attack of a note. After the note is held, it goes into a looping tremelo.

I didn't switch on the reverb here, but I am using it with medium reverb on the pattern in my track.

For a softer sound, you can use the fade-in effect (4), or alternate between fading in and hard attack for more variety in sound. I've also had success with using a fast arpeggio between 2 notes for a trill effect.

Feel free to use it in your projects under CC4 ATTR-NC-SA license. Enjoy!

P#117968 2022-09-26 03:06 ( Edited 2022-09-26 03:20)

Inst. 37 (Slap Bass 2):
[sfx]
Inst. 34 (Electric Pick Bass):
[sfx]
made like uhh probably a day or two ago.

P#81354 2022-09-26 01:18

Cart #dredds_piffle-0 | 2022-09-25 | Code ▽ | Embed ▽ | Forks ▽ | No License
7

My family like the online word game Waffle. However, Waffle only gives you one puzzle a day and my family wanted to play more often. So I wrote them this version in Pico-8. Along the way I reimagined it as an 8-bit console title with sound effects, music, particles, multiple levels, ramping difficulty, and a final “boss battle” that you unlock by completing all the preceding levels.

How to Play

Scrambled words are arranged in a grid. Unscramble all the words by swapping pairs of letters. You have a limited number of swaps to complete each level. Run out of swaps and you have to try again. Complete the level with swaps left over to score points.

Can you solve all the levels with five swaps remaining to win the title of Piffle Champion?

Play level 1 for an introduction to the controls. Playing through this level unlocks the rest of the game.

When playing a level, the pause menu gives you options to restart the level or return to the level selector. If you have difficulty interpreting the tile colors, you can enable graphical indicators on the tiles by toggling the "color blind" option on the pause menu with the left and right buttons.

Note: the game uses British English spellings, not American English spellings.

Credits

The music is by J.S. Bach, converted from a free MIDI file by the Denote tool.

P#102351 2022-09-25 22:33 ( Edited 2022-09-25 22:38)

Hi

I'm a fresher of pico-8, so I want to read some exist object code.

The default font is hard to read in launcher, so I try to use some editor like vs-code to open the cartridge file(*.p8.png), but it seems like it is a binary file and unreadable.

Anyone have some advises?

P#117960 2022-09-25 20:22

the h
based on the win animation from kirby's dream land
(do animations count as GFX snippets?)

Cart #kirbyvictorytest-0 | 2022-09-25 | Code ▽ | Embed ▽ | Forks ▽ | License: CC4-BY-NC-SA
3

P#81344 2022-09-25 19:06 ( Edited 2022-09-25 19:06)

Cart #brp_dart07-0 | 2022-09-25 | Code ▽ | Embed ▽ | Forks ▽ | License: CC4-BY-NC-SA
6

Dart-07

A scrolling shooter. As the Dart-07 you fight on Emerald Islands, Outpost in Space, and in the interstellar Phoslar Mine

This is a PICO-8 game, which I made during Basic Shmup Showcase event organised by Lazy Devs Academy.

You can play it here and on https://beetrootpaul.itch.io/dart-07 .

⚠️ Please be aware this game is under development. Mission 1 is complete and ready to play, but you enter missions 2 and 3 on your own risk 😄

If you want to take a look at the codebase, please visit https://github.com/beetrootpaul/dart-07 (the code inside PICO-8 carts of this game is minified, therefore not suitable for reading).

Controls

Keyboard:

  • press & hold x to fire
  • press c to trigger a shockwave (if available)
  • press p to open the pause menu

Virtual controller (in browser, on a mobile device):

  • press & hold ❎ to fire
  • press 🅾️ to trigger a shockwave (if available)
  • press ➖ to open the pause menu

Physical game controllers are supposed to work as well, even in a browser. Button mapping varies between models.

Gameplay

Your task is to pilot Dart-07 unit in a set of secret missions of increasing difficulty:

  • first, you mess with the enemy on Emerald Islands
  • then you continue to the Outpost in Space (⚠️ under development ⚠️)
  • in order to reach the interstellar Phoslar Mine (⚠️ under development ⚠️) and prevent the enemy from utilising that precious resource

Destroy enemies along the way to increase your score, grab power-ups left by them and survive a boss fight in order to complete a mission.

Power-ups

There are 5 types of power-ups you can grab, each of them either makes your life easier or, if cannot improve further, increases your score:

  • +1 heart – you can have max 10 hearts; you lose one whenever you take damage
  • fast movement – increases player's movement speed; does not accumulate; lost on a damage
  • fast shoot – increases shooting speed; does not accumulate, but can be combined with the triple shoot; lost on a damage
  • triple shoot – you shoot 3 bullets instead of 1, but on a little but slower rate; does not accumulate, but can be combined with the fast shoot; lost on a damage
  • shockwave charge – allows you to trigger a destructive shockwave around you (with use of "c" / "🅾️" button); you can have max 4 shockwave charges

HUD

In your HUD you see:

  • left-top: mission progression (the higher the ship's icon is placed, the close to the boss you are)
  • right-top: your score, which you gain by destroying enemies and grabbing power-ups in case they cannot bring any improvement
  • right-middle: power-ups you gathered (excluding hearts and shockwave charges)
  • left-bottom: hearts left; you die when all hearts are gone
  • right-bottom: shockwave charges left; you can trigger a shockwave if you have at least 1 charge left
  • top-middle, during boss fight: boss' health (yes, you are supposed to bring it down to zero 😉)

Recordings

Technical Challenges Tackled In This Game

In this game I focused on learning various bits of PICO-8 API.

Some of the topics I tackled in this game are:

  • multi-cart setup: this game consists of many carts – 1 main cart for the title screen etc., and 1 cart for each mission. Each mission has its own sprites and music, as well as a code responsible for available enemy types, including their attack and movement patterns. Common SFXs and sprites are copied from the main cart to missions carts with use of MEMCPY and a user data memory area (0x4300-0x55ff), preserved across loaded carts). Moreover, I implemented this in a way which allows me to use same codebase to load both locally developed carts as well as those published to Lexaloffle BBS.
  • missions defined as a map – level shape and enemy pattern are defined as sprites in a PICO-8 map, but in a simplified form (in order to fit all needed data there). Dedicated piece of code is responsible for translating sprites from map into a mission gameplay, including proper placement of edge land/structure tiles.
  • circular clipping: during shockwave a ring of inverted colors propagates from the player. To achieve that I had to learn how to implement circular clipping masks in a CPU-performant way.
  • dithered fade-in/out transition: basically a set of rectangles filled with FILLP patterns, moving over screen.
  • high score: usage of PICO-8's API to read and store data persisted on a host machine
  • code minification: with my code style (full of spaces and long names), I found it easy to hit PICO-8's characters' count limit. Therefore I forked and modified luamin tool and incorporated it into this game's build flow, resulting with characters' count reduced by around 50%.

Credits

I implemented this game on my own, as well as drawn all sprites and composed all SFXs and music. But there are some resources I found super useful and used some of them I used in the codebase as well. With huge thanks, here are those:

Version History

v0.2.0

  • new powerup type: fast movement
  • fixed diagonal speed of a player's ship by dividing it by 1.41
  • fast movement, fast shoot, and triple shoot have their status visible in a HUD
  • more health for mission 1 boss and mission 1 big enemy
  • shake camera on a shockwave trigger
  • lower volume of player shooting
  • show a win screen after first mission (the completed one)
  • print version number on a title screen

v0.1.0

  • complete game mechanics
  • complete mission 1
  • complete screens outside missions (but without music for a win screen after mission 3)
  • implemented persisted high score
P#117957 2022-09-25 18:16 ( Edited 2022-09-25 18:18)

Cart #spline-0 | 2022-09-25 | Code ▽ | Embed ▽ | Forks ▽ | License: CC4-BY-NC-SA
2

This is a tool for creating and editing splines within your game. I used this initally for a shmup i was working on where I wanted to create an intresting enemy flight pattern.

The black area represents a 128x128 screen.

Just click in the points you want then press CTRL+C to copy to clipboard This will copy all points to the clipboard as a string.

This string can be then used within your game.

This is what I use it for.

P#117952 2022-09-25 17:35 ( Edited 2022-09-25 18:26)

Cart #mot_walksim-1 | 2022-09-25 | Code ▽ | Embed ▽ | Forks ▽ | License: CC4-BY-NC-SA
7

A little texture-mapped graphics engine with BSP-tree models and fog shading.
Doesn't even try to maintain 30 FPS consistently :-)

  • Player one controls aim.
  • Player two controls strafe.
  • X/O moves up and down.

I still don't have a plan for this cart.

P#117935 2022-09-25 10:06 ( Edited 2022-09-25 10:31)

Cart #invadops-0 | 2022-09-24 | Code ▽ | Embed ▽ | Forks ▽ | No License
2

Another Space Invaders clone! I just fancied having a go at writing one, and then the particles and themes happened.

Bonus points if you get all the references...

P#117903 2022-09-24 15:14

I noticed that you can use a wireless controler to play pico , what seems relly cool, but for some reason the dpad is used in the left joystick,someone knows why is that a thing, btw, i using a ipega controler.

P#117894 2022-09-24 06:39

Hi @zep:

I was giving this some thought and think it would be good and interesting to have the ability to import a picture to sprite-sheet (or memory) directly through the import command thus:

import("?.png",0xe000,0x2000)

So in this case a file-box would appear and you can select importing a 128x128 16-color PNG directly to memory contents 0xe000. It could be a picture or an 8192-byte data file saved as a PNG.

And the opposite could also be true:

export("?.png",0x6000,0x2000)

Which would also open a filebox and this time give you a chance to save off the current screen as a single 128x128 16-color PNG file.

Defaults are memory location 0x6000 and length of 0x2000, so if you chose, export("?.png") it would save memory location 0x6000 (screen) length of 0x2000 (8192-bytes) to external file of user choosing.

' save 0xe000-0xffff to png
function savedata()
  print("save your world data")
  export("?.png",0xe000)
end

What do you fellow Piconians think ? is this something you could also find useful ?

P#117891 2022-09-24 06:05 ( Edited 2022-09-24 06:20)

Cart #celeste_lowgrav-0 | 2022-09-24 | Code ▽ | Embed ▽ | Forks ▽ | License: CC4-BY-NC-SA
6

It's Celeste, but with low gravity. All levels and berries are possible. I modified some of the levels and changed the terrain color, but otherwise all that has been changed is your walk speed, gravity, and fall speed.

Have fun!

P#117877 2022-09-24 03:05

Cart #matrix_tweet-3 | 2022-09-24 | Code ▽ | Embed ▽ | Forks ▽ | License: CC4-BY-NC-SA
4

Matrix code rain, fit in 𝟸̶𝟺̶𝟼̶ 161 characters.

changelog

2022-09-24 : Thanks to @shy help and insight on P8SCII Control Codes, managed to squeeze it in 161 characters (174 for tweeter).

P#117869 2022-09-23 23:02 ( Edited 2022-09-24 09:43)

Cart #matrix-0 | 2022-09-23 | Code ▽ | Embed ▽ | Forks ▽ | License: CC4-BY-NC-SA
6

Just a simple Matrix Code Rain.

P#117867 2022-09-23 21:16 ( Edited 2022-09-23 22:54)
View Older Posts
Follow Lexaloffle:        
Generated 2022-09-27 11:17:50 | 0.104s | Q:81