Log In  

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

I created an implementation of a queue for the game I'm working on, and thought that it could be of use to someone else. And while I was at it, programmed a stack and double-ended queue implementations as well.

To make a queue, stack, or double-ended queue, call makequeue(), makestack(), or makedqueue() respectfully. These functions return the empty queue or stack and are ready to use.

For basic queues and stacks, any attempt to add a value to the table places it at the end of the table, no matter the key you assign to it. Doesn't matter if you use t[1]=val, t.key=val, or add(t,val), it all works the same. Use t.pop to get and remove the lead value; first inserted for queue, last inserted for stack. And t.peek lets you look at the next value without removing it. t[k] will allow you to look at the value at that position, but that's mostly there so foreach and count will work.

Double-ended queues work a bit differently. Adding a value will normally add to the end table as usual, but you can also add a value to the front by using t.push_front=val or t[0]=val. Access is handled with t.pop_front and t.pop_back, which pops from first-in and last-in respectfully, and use t.front and t.back to peek similarly.

[ Continue Reading.. ]

3
0 comments


Cart #35549 | 2017-01-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

This is a throwaway prototype for my master's thesis at Full Sail. I just wanted to released it for fun. It is crap, and probably mostly unwinnable, but I'm glad I finally completed something with PICO-8.

1
0 comments


Cart #48123 | 2018-01-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9


Hello,
With Justine D we have made a third version of Time return with new levels and mechanics.

First version :
https://www.lexaloffle.com/bbs/?tid=28221

Play it and enjoy.

9
10 comments


Game dev, got Pico-8 on the humble sale and loved it. Great way to practice or learn about making your own game engine.

This is just a quick test of an action combat/physics thingy I'm working on, posted here to show friends and save me the headache of hosting myself elsewhere.

Really like how the hair turned out. Go kill some goblins. It's okay, they come back.

Cart #35506 | 2017-01-12 | Code ▽ | Embed ▽ | No License
7

7
3 comments


it seems like all the drawing functions handle the floats fine by just truncating them anyway?

is there more memory overhead to store floats vs the int we get from flr?

what about the processor overhead from calling flr every time we want a random int?

1
4 comments


Is it possible to pause or mute music in Pico-8 from script?

I want to halt the music for a short period when the player dies, and resume it when they respawn. Pause or Mute would both work in this case; I just don't want to restart the whole song every time they die.

Thanks!

This is what I currently do:

-- Player Spawns...
music(0)

--Player dies
music(-1)

-- Player Spawns...
music(0)
4
8 comments


Cart #35489 | 2017-01-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

This is my first game created with PICO-8. It is a remake of C64 game 'Crillion' from 1988 (original game by Oliver Kirwa).

I re-created all 25 levels, and tried to copy the physics and controls of the original game. Still, it seems that the PICO-8 version is a bit harder to play because the ball moves faster. Anyway, please give it a try, and share your thoughts in comments.

Sorry for the sound effects, I'm not really good at creating noises/music, just turn off sound while playing... or even better: create nicer effects and let me know about it :)

7
3 comments


Cart #35468 | 2017-01-11 | Code ▽ | Embed ▽ | No License
4

An exceedingly brief and silly discourse/joke microgame. Wander an endless graveyard, learn about daunting perils, never encounter them.

4
3 comments


Cart #35456 | 2017-01-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

0 comments


Cart #35455 | 2017-01-11 | Code ▽ | Embed ▽ | No License

0 comments


hello i have a problem when i want to make a pico 8 hand-held
i tried to run it under raspberry in a small display that’s connected to the pins(waveshare 2,8) but it turns out that when i start pico the signal is sent to hdmi i have another display from watterott same here if i tried it with pre installed img but if i use a script it works but i cant read the console any more...
there must be a problem with the scaling
can anybody help me with this i m a little lost and i want it so bad pico 8 is the best
sorry for my bad english

1 comment


Cart #35442 | 2017-01-11 | Code ▽ | Embed ▽ | No License
7


Hi everyone !
I just want to share with you my first project made in PICO-8.
It's a mix between shooter plate former that i've done for a gam jam.

Controls :

Arrows : LEFT - RIGHT

X : Shoot

C : Jump

Waiting to see your feedback ;)

7
5 comments


Hi! I'm attempting to build my first game using PICO-8 and am having some trouble with finding an online tutorial for this specific issue.

I'm looking for a simple function that will help make a defined object spawn periodically according to a timer. I've created a moving sprite and a frame counter that counts to 600 and repeats, and I'd like to have a specific enemy spawn on frame 600, instead of just spawning at the RUN command. Any suggestions?

I've included my code below, but it's admittedly very messy, as this is my first experience with programming outside of HTML. Also, if it's out of line to just hop on the forum and start pleading for help, let me know too! :P

[box=ffeedd]--nessie
player={}
player.x=64
player.y=64
player.sprite=1
player.speed=1

--redbads
redbad={}
redbad.x=flr(rnd(128))
redbad.y=flr(rnd(128))
redbad.sprite=6

--bluebads
bluebad={}
bluebad.x=flr(rnd(128))
bluebad.y=flr(rnd(128))
bluebad.xdir=4
bluebad.ydir=4
bluebad.sprite=5

--timer
frame={}
frame.count=0

--spawncount
spawn={}
spawn.count=0

function _move()
if btn(0) then
player.x-=2
elseif btn(1) then
player.x+=2
elseif btn(2) then
player.y-=2
elseif btn(3) then
player.y+=2
end
end

function _direction()
if btn(0) and
player.sprite<3 then
player.sprite+=2
elseif btn(1) and
player.sprite>2 then
player.sprite-=2
end
end

function _screenedge()
if player.x<0 then
player.x+=4
elseif player.x>120 then
player.x-=4
elseif player.y<0 then
player.y+=4
elseif player.y>120 then
player.y-=4
end
end

function _dive()
if btn(4) and
player.sprite==1 then
player.sprite+=1
elseif btn(4) and
player.sprite==3 then
player.sprite+=1
end
end

function _surface()
if btn(5) and
player.sprite==2 then
player.sprite-=1
elseif btn(5) and
player.sprite==4 then
player.sprite-=1
end
end

function _redchase()
if (frame.count%2==0) then
if (redbad.x-player.x)>0 then
redbad.x-=1
elseif (redbad.x-player.x)<0 then
redbad.x+=1
end
if (redbad.y-player.y)>0 then
redbad.y-=1
elseif (redbad.y-player.y)<0 then
redbad.y+=1
end
end
end

function _timer()
if frame.count<60 then frame.count+=1
else frame.count-=61
end
end

function _spawncount()
if spawn.count<600 then spawn.count+=1
else spawn.count-=601
end
end

function _bluedice()
if frame.count==30 then
if (flr(rnd(128)))>(flr(rnd(128))) then
bluebad.xdir-=2
if bluebad.xdir==0
then bluebad.xdir+=4
end
end
if (flr(rnd(128)))>(flr(rnd(128))) then
bluebad.ydir-=2
if bluebad.ydir==0
then bluebad.ydir+=4
end
end
end
end

function _bluemove()
if (frame.count%2==0) then
if bluebad.xdir==4 then
bluebad.x+=1
else bluebad.x-=1
end
if bluebad.ydir==4 then
bluebad.y+=1
else bluebad.y-=1
end
if bluebad.x<0 then
bluebad.xdir+=2
elseif bluebad.x>120 then
bluebad.xdir-=2
elseif bluebad.y<0 then
bluebad.ydir+=2
elseif bluebad.y>120 then
bluebad.ydir-=2
end
end
end

function _update()
_move()
_dive()
_surface()
_screenedge()
_direction()
_redchase()
_bluedice()
_bluemove()
_timer()
_spawncount()
end

function _draw()
cls()
--clear the screen
rectfill(0,0,128,128,1)

--draw nessie
spr(player.sprite,player.x,player.y)

--draw redbad
spr(redbad.sprite,redbad.x,redbad.y)

--draw bluebad
spr(bluebad.sprite,bluebad.x,bluebad.y)

--draw framecount (del later)
print(frame.count,12,6,15)

--draw spawncount (del later)
print(spawn.count,25,6,15)

end

[ Continue Reading.. ]

2
14 comments


Cart #35361 | 2017-01-09 | Code ▽ | Embed ▽ | No License

A Pico-8 greetings card.

Art and code by reallyfancy, music by radian.

Uploaded to itch earlier, and belated new years greetings to the Pico-8 BBS

0 comments



UPDATE: Today is monday the 16th.

Now leeches are one solid creature, and the camera follows their head.

Press z to lock/unlock cam.
Press x to randomise leech (only 3 breeds atm)

You can change the variable BORD to change the border size.
If you wanted, you could probably figure out how to add a new leech breed.

5 days until the deadline.

Cart #35358 | 2017-01-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

first post.
eventually this will be a virtual pet game.
I'm making it for the winter 2017 my first game jam on itch.

gradually getting my head around lua.

1 comment


Hey All,

First post here after recently picking up and playing with pico-8 (humble bundle). It's rather brilliant I have to say!

I have only been playing around with coding for a couple of months and remain very much a novice, and this is my first time using lua with pico-8.

My question is regarding tables of tables (objects I am spawning in my game), and the deletion of those objects...

Let's say we have the following little program which spawns 5 THINGS, gives them unique names, and then adds them to the list a{}. We then delete the item with NAME=3, and then print some output...

a = {}

for i=1,5 do
	local thing = {}
	thing.name = i
	add(a,thing)
end

for thing in all(a) do
 if thing.name == 3 then
  del(a,thing)
 end
end

for thing in all(a) do
 print(thing.name)
end

print("# = "..#a)
print(a[3])

Output is: 1, 2, 4, 5, # = 4, TABLE

This works fine, and is the standard practice I have been using to remove objects from the master table.

However, let's say I already know which item on the main table (a) that I want to delete by its index, say the third item... i.e. a[3]

[ Continue Reading.. ]

3 comments


Cart #35329 | 2017-01-09 | Code ▽ | Embed ▽ | No License
1

The beginning of an attempt to recreate "Combat" from the Atari 2600.

Tanks and movement only at this point. No bullets or collisions yet.

A lot of the code was borrowed from "Blasteroids" by Lulu Blue as detailed in Pico Zine #3.

1
5 comments


Cart #35323 | 2017-01-09 | Code ▽ | Embed ▽ | No License


Press n to shoot and m to protect you from dmg

0 comments



2
4 comments


Cart #36796 | 2017-01-28 | Code ▽ | Embed ▽ | No License
16

Cart #36139 | 2017-01-20 | Code ▽ | Embed ▽ | No License
16

Cart #35583 | 2017-01-13 | Code ▽ | Embed ▽ | No License
16


Just a little procrastination project. Not sure if it's going anywhere. Very early demo just showing movement and tiles.
16
12 comments




Top    Load More Posts ->