Log In  

BBS > Superblog
Posts: All | Following    GIFs: All | Postcarts    Off-site: Accounts

I've of course found plenty of things on doing queues in lua all over the web, but it appears pico 8 has fewer of the main lua libraries available.

What I'd like to do is have a queue for passing messages to coroutines for "commands" to process. TBH it's probably overkill, but I'd like to know how anyway.

I know I can add(x, 10) to append to a table. But then there's del, which apparently only searches for a value and deletes it. I'm surprised there's no mirror operation to add which would remove from the end (or start) of a table. That's what I'm looking for, I think.

1 comment


Cart #40286 | 2017-05-07 | Code ▽ | Embed ▽ | No License
1

1
0 comments


Cart #40479 | 2017-05-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

0.6: fixed invincibility bug

Cart #40275 | 2017-05-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

Pushback is a simple action game based on the Ludum Dare theme "One Room".

How to play:
You are the center yellow block. Use the green blocks to push the red monsters back and squish them against the walls.

If the red monsters get next to you, they'll attack you, and you'll get progressively bloodier. Lose all your health and you lose.

[ Continue Reading.. ]

7
3 comments


Cart #40272 | 2017-05-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

2
0 comments


Cart #40282 | 2017-05-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

1 comment


Cart #adventurecreator-8 | 2021-01-12 | Code ▽ | Embed ▽ | No License
16

This is a demake of Adventure Creator, an old Atari 400/800 game. It's not my goal to perfectly imitate the game, just get enough of it in there to be fun and nostalgic to play.

The original game was by Spinnaker/Dale Disharoon on the Atari 400/800 released in 1984.

It is dedicated to the memory of Dale Disharoon who died in 2008. His game gave me and my sister Katy a lot of fond memories together. I hope this demake honors his memory and preserves his legacy in some form.

It's a bit of a strange and probably outdated game. It is best described as a roguelike with questionable mechanics. But it makes a fun toy, and probably interesting to small children and anyone who remembers the game.

[ Continue Reading.. ]

16
2 comments


I've got some code similar to this in my game for different types of entities.

knight.sm=cocreate(
 function ()
  while(knight.alive) do
   w=knight.w
   h=knight.h
   s=knight.s

   if btn(0) then

... ... .. ..

Basically inside the function I'm creating a coroutine from I just use the "knight" reference from global scope as a "this" reference, so to speak. But...now I want to create a different type of entity within a loop, using a similar approach to the above.

 for m=1,10 do ::redo::
  .... 

  chest.sm=cocreate(
   function()
    while chest.alive==true do

The problem I'm running into is that that "chest" variable inside the loop, only ever seems to refer to one chest (presumably the very first time the function() is processed by lua).

I want to create a coroutine for each chest entity, which has a reference to "that" chest for each one in the loop. I'm sure there's a way to do something like that but I'm fairly new to lua.

1
1 comment


Cart #41029 | 2017-05-27 | Code ▽ | Embed ▽ | No License
143

Also available on itch.io, Indiexpo, and Kongregate.

Walkthrough

Kelin's artwork:
https://www.pixiv.net/en/users/12757087/illustrations/Kelin

--

Hello, Everyone!!
This is my first game... in PICO-8.

The game is about Kelin who has a job to deliver a package to her client. However, rain comes and Kelin has to stay in an unused old house because the path to cave is blocked. She is also hungry. Help Kelin find food and something to rid the cave block in the old house with adventure gameplay mechanic!

[ Continue Reading.. ]

143
66 comments


Cart #40233 | 2017-05-06 | Code ▽ | Embed ▽ | No License

For my first project, I'm making some relaxing scenes based on the seasons. Very much a work in progress now...

Scene 1: Summer [in progress]

press [x] to randomize the clouds.

0 comments


Cart #40228 | 2017-05-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
16

Just a simple little 2D-rotation example.

The function takes a 2D position (X,Y) and rotates it by ANGLE. CX,CY represents the center/pivot point.

The lines of code in the middle are the rotation matrix:

local rotx=cosa*x-sina*y
local roty=sina*x+cosa*y

This rotates a point around the origin. Before and after doing so, we offset our position by our center coordinate - this lets us rotate around any arbitrary pivot point.

For bonus points: When you're rotating lots of objects by the same angle (like a camera rotating, or a complex prop rotating), you can re-use your SINA and COSA values.

16
3 comments



This is a playing cards library, spent quite a while on it.

It allows you to both store playing card data and render the data. Read the comments for usage.

8
2 comments


Cart #40200 | 2017-05-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

This is my Blackjack cart. I don't plan on doing much more with it, as I've moved onto other things for the time being. If anybody wants to finish it up or post fixes, I'll update it with credit :)

1 comment


Cart #40192 | 2017-05-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
37

It's May the 4th, otherwise known as Star Wars Day - so I made a little something :).

Swing away, and may the gamedev force be with us all! :)

37
3 comments


You know that feeling when you only have 8x8 pixels to draw something, and it takes an hour to get it right?

Let's make that feeling worse by posting our sprite in this thread, without context, and then despair when none of the other users can figure out what it is.

I'll shamelessly start it off with this thing...

And no, it's not pikachu... :(

5 comments


Hey, first of all, excuse my poor photoshopping (Using Krita on Linux, terrible tool. No idea why I'm not using Gimp).

But anyways... What if, while in the code editor, you could hold down a key (maybe ALT?) and it would turn all tokens into coloured blobs. So you could instantly see where and how most of them are used up.

Something like this:

Additionally, maybe instead of being randomly coloured, certain tokens (such as keywords, variable names, separators, etc...) could have a dedicated colour to them.

Now, disclaimer... I don't actually know how the tokens work exactly, I just coloured in the tokens as I felt.

The token blocks themselves, should also look more like this, but in pico8 colour palette:

but I think the image gets the point across even with my terrible photoshopping.

2
1 comment


Cart #40179 | 2017-05-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

arrow:move
z:gather number from around.


This is 1st game I made.
I learned how difficult it is to make the game fun.

0 comments


Cart #crowd-3 | 2023-11-18 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
81

NOW WITH EARS!

CROWD is multiplayer hide'n'seek'n'shoot'n'collect game for 2-4 players

controllers recommended

MERRY X-MAS after checking help

81
16 comments


Hey!

I want to find a way to run my code from other editors such as vim or atom. I havent found a solution to this yet.

I know I can run a cartridge from terminal by typing "pico8 -run mycart.p8" for example. The problem with this is that it boots up the whole console before booting the game.

Do anyone know a way to just boot the game in an already running pico-session? That would be awesome.

EDIT: I just got the idea. If you run load("mycart.p8") in your code the cart gets reloaded and run with the new code. Is it possible to use the gpio to send a command that triggers load("mycart.p8") within the code? For a computer that does not have real a gpio-header I guessing you would have to simulate gpio?

3 comments


Cart #40162 | 2017-05-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Cart #40159 | 2017-05-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

This is my first game, please enjoy!

1.1 fixed controls on title screen

1
0 comments


Cart #40919 | 2017-05-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

Cart #40801 | 2017-05-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

So this started on this thread by weeble but I ended up rather... running away with the code idea and overhauling it drastically.

While I've resumed working w/ Weeble on this in his original thread, I'm keeping this thread updated as well as I make changes.

V2.0 details
[hidden]

Cart #40742 | 2017-05-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

Cart #40463 | 2017-05-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

Cart #40406 | 2017-05-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

Cart #40386 | 2017-05-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Cart #40308 | 2017-05-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

Cart #40147 | 2017-05-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

Cart #40129 | 2017-05-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

Also with V2.1 I've moved the various data tables needed outside of the sprite sheet, copied up from page 3 which is the one tiles are rendered into in-game, so all of the first two sprite pages are available for graphics as is the first two rows and change of page #2.

With V2.2 I've added the initial code for clipping regions, to avoid redrawing the entire screen every frame. This is a MASSIVE speedup, pushing CPU usage outside of screen-transition periods down to 5% CPU at 60fps in most cases. I'm working on a '16x16 bitfield' based solution that will instead re-render the screen in regions as small as 8x8 pixels per frame, allowing for multiple moving objects that way.

I've also cut the CPU used for baking the tile graphics in half from ~2.5 frames at 60fps to ~1.3 frames at 60fps with this release, while the token count and overall codesize has actually gone down.

Finally, the game picks a random room in the entire 16x16 grid to start you in, so you get different areas of the maze each time you restart the cart. So hit Ctrl+R a few times to see all the various biomes.

As a caveat I have removed the 'biome viewer' in this version for now, as I'm redesigning the interface to be a general-purpose editor for the maze itself, including setting biomes on the maze and editing individual biomes directly.

As of V2.3 I've integrated newer 'cavern generation' code that weeble came up with, to avoid blocking paths and allowing for much denser 'crazyness' to occur, as well as my 'context sensitive dithering' code which makes the transition tiles look much more alive and distinct now.

I'm working on some additional cavern smoothing functions to retain the 'crowded' feel without having quite so many dead side-passages at times, and adding a caching layer for the more expensive parts of the room-generation, to allow much of it to be generated in the background as you walk around a room to get to the next exit.

V2.4 adds a fourth unique room design for some biomes, one with much deeper, winding passages and a crowded feel.

V2.5 adds a MASSIVE speedup to the bake_tiles function by calculating the 'masked' tiles a full 32-bit row of 8 pixels at a time. So one fourth as many calculations in exchange for a bit of bit-shifting to load/save the values, but overall it's a HUGE win, including on token-count! Only 2814 tokens current! :D As a note, the masking colors are now 2/3, 4, 5, and 6/7, with values 0, 1, and all those above 7 MUST be avoided in the masks now.

As an interim release, V2.5-caching includes a further sped up tile-rendering codebase which is also moving some data from peek/poke memory to lua memory, taking up roughly 128k of the 1MB available with pre-rendering graphics tiles organized for faster rendering. This transition is freeing up enough speed that I am preparing to remove the 'biome' approach and allow direct per-maze-room assignment of walls, floors, and borders (including palettes) to simplify world painting. The trade-off is worlds will take ~768 bytes of sprite/map memory to store instead of ~512 bytes as they are now.

[ Continue Reading.. ]

22
5 comments




Top    Load More Posts ->