So I'm new to Pico-8, and I've been studying tutorials on how to get things working. I've been trying to start develop a game state system based off of a tutorial. I've got a very minimal main menu setup with a sprite for a cursor, but for some reason my system that I attempted to replicate for the sake of testing from the tutorial identically just does not run a function, and my screen is just blank. Why wouldn't it be working? Any help would be really appreciated from a new and enthusiastic Pico-8 learner. The code is below:
function _init() cls() scene="menu" cursr_x=64 player={ x=0, y=0, } end function update() if scene=="menu" then update_menu() elseif scene=="game"then update_game() end end function draw() if scene=="menu"then draw_menu() elseif scene=="game"then draw_game() end end function draw_menu() cls() spr(12,20,20) spr(18,cursr_x,64) end function update_menu() --move cursor left if btn(⬅️) and cursr==64 then cursr_x=32 elseif btn(⬅️) and cursr==32 then cursr_x=96 elseif btn(⬅️) and cursr==96 then cursr_x=64 end --move cursor right if btn(➡️) and cursr==64 then cursr_x=96 elseif btn(➡️) and cursr==32 then cursr_x=64 elseif btn(➡️) and cursr==96 then cursr_x=32 end end |
it's the game snake, but 3D, in 552 bytes! this lil thing was made for TweetTweetJam 7.
moving: steer with left/right - steering is also how you move forward, because you are a snake
growing: eating olives is how you grow longer, because you are a snake
losing: touching your tail with your face is how you start over, because you are a snake in a video game
if you grow your tail so long that your framerate suddenly reduces to garbage: you win!
the code is nonsense, since it's a tweetjam, but here it is!
p={0,0,0,0}b=0a=0g=0h=0::_::cls(15)w=btn()w=w%2-w\2%2m=w*w*2a+=w*.015p[3]+=m*cos(a)p[4]+=m*sin(a)q=p[3]r=p[4]g+=(q-g)/9h+=(r-h)/9b+=(a-b)/40s=sin(-b)c=cos(-b)for j=0,1do for i=1,#p,2do _=min(i,2)u=p[i]v=p[i+1]f=_+2if(1-j)*i>=5then x=p[i-2]y=p[i-1]u-=x v-=y l=2/(u*u+v*v)^.5u=x+u*l v=y+v*l p[i]=u p[i+1]=v end if abs(q-u)+abs(r-v)<30-_*10then if i<2then for j=1,36do add(p,p[#p-1])end p[1]=rnd(198)-99p[2]=rnd(198)-99 elseif i>40then run() end end u-=g v-=h u,v=s*u+c*v,c*u-s*v k=99/max(150+v,1)circfill(64+u*k,34+60*k-j,5*k-j,f+j*5)end end flip()goto _ |
Older Version:
Made for #Seajam
Usage (requires keyboard): Type text including control codes (\n, \f, \^, #, and more) live in your terminal and see the result displayed on screen...
You could also just edit a print() statement in a dummy cart and reload... but there's something about being able to edit color/spacing/etc 'live', especially for codes like + and \^v that can take a lot of trial-and-error tweaking.
In the comments below I have a larger utility cart version of this that includes help, save/load/export, and so on. But this first post is trying to pack a subset of that into 560 characters for TweetTweetJam.
p.s. The tweetcart it doesn't quite support all the P8SCII codes (no \a, |, -, and likely more), but the full cart in the comments supports most of them (still not \a).
I'm trying to use a breadth-first search on a grid for path finding. My code works for a grid of 7x7, and just barley for 8x8, but it runs out of memory at 9x9. I was just wondering if there was a way I could do things differently to keep the memory usage down.
function grid:findpath(src,dest) function buildpath(node) local path={} local current=node while current do add(path,current,1) current=current.parent end return path end local dirs={ {x=-1,y=0}, {x=1,y=0}, {x=0,y=-1}, {x=0,y=1} } src.parent=nil local queue={} local visited={} for y=1,grid_size do local row={} for x=1,grid_size do add(row,false) end add(visited,row) end add(queue,src) while #queue>0 do local node=deli(queue,1) visited[node.y][node.x]=true if node.x==dest.x and node.y==dest.y then return buildpath(node) end for dir in all(dirs) do local new_node={ parent=node, x=node.x+dir.x, y=node.y+dir.y } if new_node.x>0 and new_node.y>0 and new_node.x<=grid_size and new_node.y<=grid_size and visited[new_node.y][new_node.x]==false and self[new_node.y][new_node.x]==0 then add(queue,new_node) end end end end |
Thanks
Tuck and Rolo is about being a cool skeleton (Tuck), collecting mushrooms, and tackling fiends, all with the help your fire-spitting, mostly-loyal bird friend (Rolo). It is an action platformer with a scoring system that rewards exploration and survival over speed.
This game was originally an outlet for me to get familiar with pixel art and to experiment with an OOP approach to game entities in PICO-8 (https://www.lexaloffle.com/bbs/?tid=30886). For years, Tuck and Rolo was more of a scratchpad than any sort of product with a direction. Eventually I decided that not having a finished game was silly. With the addition of scoring, NG+, and music, I felt it was worth releasing. It's come a long way: https://www.lexaloffle.com/bbs/?tid=30552
Binary downloads are included in the game page on my website: https://walt.codes/tuck-and-rolo/
The music is by D.D. Curry: https://soundcloud.com/dd_curry
Game for one or two cooperative players.
Fight against various enemy hordes, space phoenixes, asteroids, minibosses, abandoned structures until you reach the final great enemy in this arcade game inspired by the classics.
Features
-One or two simultaneous players in cooperative mode
-Seven different hordes
-Normal enemies
-Phoenix
-Asteroids
-Triangles Mini-Bosses
-Structures
-Final mega boss level
-Debug option that allows you advance a level if you get blocked
Game controls
Player #1
-Cursor left and right to move
-Z key to shoot
-X key / cursor down to use shield
Player #2
-Keys S and F to move left and rigth
-W key to shoot
-Q key / D key to use shield
Tips
You can use shield when shield bar is full (purple bar in the top of screen)
While using shield, you can't move the ship but you can shoot
Game developed using PICO-8.
My submission for TweetTweetJam 7 - a Breakout-like game using 560 characters!
Check out the other TweetTweetJam7 submissions: https://itch.io/jam/tweettweetjam-7
Some of the other submissions I've seen so far are mind-blowing, and certainly give inspiration for the future!
Controls:
Arrow Keys: Move Paddle
Z: Restart
welcome back, bubble cat. we have another situation, and this time you've only got 60 seconds
how to play:
- arrow keys: move
- ctrl-m: mute
- X/Z: continue to next level
you don't have to full-clear every level! skipping a level without clearing it just gives you a points penalty (-5 per remaining bubble)
code:
this game was made to fit inside two tweets; i.e. <560 characters of code and no sprites! here's the full code:
x=3y=3o={}m=0n=0p=circfill::_::z={}for j=1,13do z[j]=rnd(49)\1end?"⁶!5f2cC" while t()<60do?"⁶1⁶c" b=btnp()q=b>8and"⁷fdc"d=sgn(n-m)u=x if(n~=m)m+=d d+=6 p(32,32,60-t(),1)v=y?"⁶w⁶t"..m,24,27,4+d if(b%16>0)s=b*.5938&.75 if(not r)r,s=s if(r)x+=cos(r)y+=sin(r) w=x\7+y\7~=0 for j=#z,1,-1do i=z[j]d=q and"-5"b=i\7*9a=i%7*9p(a+4,b+4,3,j|8) if(y*7+x-x\7==i)w=del(z,i)d="+1"?"⁷d" if(#z<1)d="+10"q="⁷egc4" if(d)add(o,{d,a,b,d*11})n+=d end?"★⁵8d🐱",x*9+1,y*9+3,7 if(w)x,y,r=u,v for a in all(o)do a[3]-=1?unpack(a) end?q or"" if(q)goto _ end?"⁷dafa" ::e::goto e |
(that's only 548 characters, but some of them (like the cat face) cost two characters on twitter. remember to ctrl-p to enter puny-text mode before pasting this into your local console!)
some code highlights:
- convert btnp() bitfield into movement:
b=btnp()if(b>0)s=b*.5938&.75if(r)x+=cos(r)y+=sin(r)
- buffered input:
if(not r)r,s=s
- out-of-bounds check:
w=x\7+y\7~=0
- animated score display:
d=sgn(n-m) if(n~=m)m+=d
- collision checking:
if(y*7+x-x\7==i)
- draw player:
?"★⁵8d🐱",x*9+1,y*9+3,7
- animated score floaters:
for a in all(o)do a[3]-=1?unpack(a) end
full code history:
https://github.com/pancelor/bubble-cat
high score:
my high score is 207! 240! what's yours?
Here is my Pico-8 version of the Game Boy Advance game Denki Blocks from 2001.
Features:
- 235 puzzles
- 2 unsolved puzzles unlocked at a time
- undo last move
- reset level
- Best time and best moves are saved per level with cstore
- Cheatmode
Have fun!
Hi, I'm new to the scene here- I'm just writing a text adventure game and I'm looking for a way to scroll the text or just get the player to the "next page" of text? The map I load into the game is only a drawn border or fancy frames for the game... This is the code I have as of now, but the program skips to the last update function when I press the 'X' button/key in the game is the problem I currently am faced with. I also have yet to figure out an inventory system or anything similar. I know my code isn't clean- nor is it efficient, but I'm just looking to do a text adventure. Any help is appreciated however!
-- main
cls()
-- prints map
map()
-- beginning
print("my story text here",15,20)
print("my story text here")
print("\n")
print(" (hit x to continue)")
print(" other buttons displayed here",20,100)
print(" ")
-- button pressed
function _update()
if (btn(X)) then
-- scroll text
cls()
-- prints screen
map()
-- beginning
print("my story text here",15,20)
print("my story text here")
print("\n")
print(" (hit x to continue)")
print(" other buttons displayed here",20,100)
print(" ")
end
end
function _update()
if (btn(X)) then
-- scroll text
cls()
-- prints screen
map()
-- beginning
print("my story text here",15,20)
print("(hit the < key to (do "something")")
print("(hit the > to (do "something")")
print("️ other buttons displayed here",20,100)
print("my story text here")
end
end
Hello fellow Pico-8 fans
It's still a work in progress, but thought folks could check it out and have more fun. Thanks to @Krystman and LazyDevs for getting me up to speed with Pico-8. More acknowledgements below. But thought I'd start out with some early thanks :)
How to play the game
X - Launch Ball
C - Launch Bomb (need to gain them with bomb powerup)
Left - Move Paddle Left
Right - Move Paddle Right
When in the Piconoid start screen
Left - Show Highscores
Right - Hide Highscores
Up/Down - Level select (I opted to add this feature to have fun with the different levels)
Goal is to hit the bricks, and clear them all before advancing to the next level. There are 9 levels (more to come).
Powerups
The original power ups from breakout hero are there AND I added a few more power ups.
New Powerups...
Lazor - Hit Z to shoot!
Multipaddle - A new paddle will appear on top of the existing one
Bomb - Hit Z to send off a bomb vertically. These can destroy invincible bricks
Bomb ball - changes bricks into exploding bricks
Powerup ball - changes bricks into powerup bricks
There are four backgrounds
Circuits
Cells
Starfield
Rain
New Update
- Highscores
- New Powerup - Powerup Ball - changes bricks into powerup bricks
- Updated/New Levels - Jelpi, Pico8s, Maze, Core, Metroid, Buttonz, Heart, Evil Eye, Facey
- Updates to the graphics and soundfx
- Fixed bugs
Another Update
- Added banana power up... my daughter's idea :)
- Makes the ball go faster and unpredictable angles
- Added paddle ram check
- Added clip so that you can see the ball behind sash
- Level select menu on start screen
Finally, again a HUGE thanks to LazyDevs for putting out the Breakout Hero tutorials. I wouldn't have made it this far this quickly without them. And Huge thanks to the community for a whole lot of other tips and tricks.
Any feedback and comments about the game, gameplay, the code, etc... would be great.
Enjoy : )
arrow keys to move the buoy
Explore the lake, get to the finish line, and avoid getting popped on the rocks!
reeds slow you down, the current gives you a boost, and sharp rocks pop your buoy.
Hello all...
I've been looking up how to have leading 0s on my score displayed on screen.
Some of the explanations I've seen look very complicated.
How difficult is it to have, say 00050 rather than just 50 displayed as the player score.
Thanks
Peej
You're chased by piranhas and need to escape.
A very basic version of a game my father developed on a Thomson TO9, back when I was a kid.
It's my first go at a game on the PICO-8. I accidentally fist came across that fantasy console last week and absolutely felt in love with.
The game works better on a big screen as you character (green dot) and the piranhas (red dots) are way too small to view on smaller screens.
I need to play around within the constraints of the PICO-8 to find a way to have bigger items while still allowing to have a few hundred piranhas to deal with. Maybe some kind of zoomed and cropped version of the game.
Anyway, “release early, release often”. Any feedback will be appreciated.
Thanks.
Pretty happy with how this turned out. Managed to implement everything I wanted to within the limitations.
Character count: 560 (558 in-editor)
cartdata("focus_ttj7")d=1/16f=rectfill h=dget(1)l=0m=127p=66t=0v=0y=62cls()?"move:⬆️/⬇️",p,p,7 ::_::t+=d if(t==0or l>0)v=l>0and"hit the red"or"won"goto u f(0,y,3,y-3,0) if(btn(2))y-=1 if(btn(3))y+=1 if(y>m)y=m if(y<0)y=0 for i=1,m do for j=0,m do pset(i-1,j,pget(i,j))end end for i=0,3do for j=0,3do if(pget(i,y-j)>7)l=1end end p+=flr(rnd(9/4)-5/8)if(p>m)p=m-1 if(p<11)p=12 f(m,-1,m,m+1,8)f(m,p,m,p-11,0)f(0,y,3,y-3,7)flip()goto _::u::?"you "..v.."!\n\nscore: "..t.."\nhigh score: "..h,1,1,7 if((t>h and h>0)or(t<d and h>t))dset(1,t)?"new record!" flip()goto u |
Hello, this is my new Pico-8 game, made for the VGL Gamejam.
Hope you enjoy my game as much as I enjoyed making it!