Not a overly flashy game. but a personal challenge I set my self to better understand how to code.
I wanted to make a very basic calculator to better understand how to input and compare variables and output an answer. the two variables will increase in randomness based on your correct answer score. The operation are limited to addition subtraction and multiplication, No division as that would require a decimal place or to check the answer is a whole number which i have yet to finger-out.
--controls:--
use arrow key to navigate key pad.
press Z to input your answer
press X to submit your answer (or select the return button on key pad)
selecting the C button on key pad will clear your current answer.
--please help--
If anyone know how to check for a whole number please put in comments below
having a issue with numbers over 9999? seems to generate is know random number if i try to input a number over this. Is this a limitation with the programming language or my programming skills?



Hi!
I'm just starting out with pico8. can I somehow split my code into several files? So that I can easily re-use certain functions, or libraries like https://github.com/clowerweb/Lib-Pico8/
How would I import them (putting them into lib/file.lua
then import "lib/file.lua"
does not seem to work – it doesn't expose the defined functions.



Hi,
I think this is a bug:
- create a simple cart:
function _draw() cls() spr(001,0,0) end |
- save it
- draw a painted sprite at position 001
- export the sprite sheet (do not save the cart!)
- load the cart
- run the cart, nothing is visible
- import the sprite sheet
- run the cart, nothing is visible!!! my expectation was that the sprite would be visible
- escape and switch to the sprite editor: no painted sprite at 001
-
reboot
- load the cart
- import the sprite sheet
- switch to the sprite editor: painted sprite at 001
- run the car: visible sprite.
So it seems that switching to the sprite editor after importing a png does something that is not performed only by importing the png.
-- Use the arrow keys to move up and down, press x for a boost in either direction. Game objective is to color the ground light green as you pilot the sun through the sky, with the color changing based on how close the sun is to the ground. Loosely based off of the myth of Apollo/Helios dragging the sun across the sky.
-- Hope y'all have fun and enjoy the challenge!

Hey.. Can someone please explain what's going on here for me?
Here's a test cart that prints the content of table 'x' (a table with the first 16 offsets set to 1 by default) and the value of '#x'..
LEFT/RIGHT changes the offset of table 'x'
X sets the offset to 1 / Z (O) sets the offset to nil
If I set certain values to nil in a table, then len will start returning 0 even though there are still items inside the table. This seems to happen when a 'certain' number of items, including the item in offset=1 are set to nil, and then offset 0 or offset -1 are set to nil:

This doesn't seem entirely consistent.. Here, if I start at offset 7 instead of offset 13, then len still returns the highest index with non-nil data. Even if I'm setting offset 0 or offset -1 to nil:




Hi, this is a very very basic cart I made to experiment with music bars.
the "music" is crap because I didn't have much time to write some decent.
I need this for a bigger project (some kinda demo!!) that I'm currently working on,
I figured out it would be useful to someone.
At first I didn't find out much info about the memory storage of SFX and music,
but just after I figured out on my own how the bytes stored the info about notes and stuff,
I found this guide, which would have been quite useful if I just... well, if I had found it before.
https://gist.github.com/paniq/7814560e2b560b76911b
Nevermind,
hope you enjoy this!
A bad demake of the mobile game of the same name (iOS and Android)
Try not to miss the platforms, they get faster and smaller the longer you survive! Hit the center of platforms to keep the platforms big!
Probably done with this, leaving it in WIP because it's not really "finished"
CC4 is too restrictive so here's the license for my cart - it's just public domain in case anyone wants to use anything from it (I'd recommend against even reading my code, though!)





Arcade wizard game made in 48 hours for GMTK Jam.
Press Z to jump, X to shoot magic missile. Down+Z to drop through platforms.
Smash all the gems with your magic to advance to the next level. When you shoot the missile, you're left vulnerable, so be careful! See how far you can get and set the high score.



@zep:
Any chance we could get the added value back from add(t,v)? I ask because it would simplify code a lot of the time. For example, I have a job manager I'm playing with that has a function like this:
function job_call( cor ) local job = { cor=cor, is_call=true } add( _jobs, job ) return job end |
If add(t,v) returned v, I could write it like this:
function job_call( cor ) return add( _jobs, { cor=cor, is_call=true } ) end |
Nicer, right? Cleaner, fewer tokens. I think that even lets the compiler implement it as a tailcall.
I know it's just a minor thing, but quality-of-life stuff like this can be really nice to have. (Kinda like built-in is_empty(t), cei(f), or sincos(a) would be, among others, wink, wink, nudge nudge.)
What do you say? I can't think of any way it would break backwards compatibility. Please? :)


function arc(x, y, r, angle, c) if angle < 0 then return end for i = 0, .75, .25 do local a = angle if a < i then break end if a > i + .25 then a = i + .25 end local x1 = x + r * cos(i) local y1 = y + r * sin(i) local x2 = x + r * cos(a) local y2 = y + r * sin(a) local cx1 = min(x1, x2) local cx2 = max(x1, x2) local cy1 = min(y1, y2) local cy2 = max(y1, y2) clip(cx1, cy1, cx2 - cx1 + 2, cy2 - cy1 + 2) circ(x, y, r, c) clip() end end |
This function draws an arc by drawing a circle four times with different clipping regions.
Limitations:
- Can't draw a filled arc (but you can change the circ to a circfill for an interesting effect!)
- Can't set starting angle (but this would probably be easy to implement)




I made this game for the Game Maker's Toolkit Game Jam on itch.io.
The theme was Downwell's Dual Purpose Design. In this game you can only move by dive kicking. I ran out of time to implement enemies, but the dual purpose would be attack and movement. The dive kick button is the same as the jump button as well.
Press Left or Right to face left or right on the ground. Press either of the X or O buttons (Z, X on keyboard) to Jump from the ground. While in the air, press the same button to dive kick.
Thanks to @MBoffin on here and twitter for the code for the camera movement!
Hello y'all,
I'm working on making a puzzle game, and I've come across a problem with the collision detection/map reading when I try to change to the next map. I think this stems from the fact that I'm missing a concept somewhere on how maps work. Everything seems to work find until I move to the third map...not sure what I'm missing.
--sprite 0 is blank --sprite 1 is player --sprite 2 is to mark where the player spawned --sprite 16 is wall function _update() moveplayer() solidstuff() end function _draw() cls() map(0,0,0,0,16*3,16) spr(1,player.x,player.y,1,1,0,false) camera(cel_x*8,cel_y*8) end function moveplayer() --moving player if btnp(0,0) and solid.li!=16 and solid.lf!=16 then player.x-=player.dx end if btnp(1,0) and solid.ri!=16 and solid.rf!=16 then player.x+=player.dx end if btnp(3,0) and solid.di!=16 and solid.df!=16 then player.y+=player.dy end if btnp(2,0) and solid.ui!=16 and solid.uf!=16 then player.y-=player.dy end --switches the map if btnp(5,0) then cel_x+=16 readmap() player.x+=16*8 end if btnp(4,0) then cel_x-=16 readmap() player.x-=16*8 end end function readmap() for x=0,15 do for y=0,15 do tile=mget(x+cel_x,y+cel_y) if tile==1 then mset(x+cel_x,y+cel_y,2) player.x=x*8 player.y=y*8 end end end end function solidstuff() solid.di=mget(flr((player.x)/8),flr((player.y+8)/8)) solid.df=mget(flr((player.x+7)/8),flr((player.y+8)/8)) solid.ui=mget(flr((player.x)/8),flr((player.y-8)/8)) solid.uf=mget(flr((player.x+7)/8),flr((player.y-8)/8)) solid.li=mget(flr((player.x-1)/8),flr((player.y)/8)) solid.lf=mget(flr((player.x-1)/8),flr((player.y)/8)) solid.ri=mget(flr((player.x+8)/8),flr((player.y)/8)) solid.rf=mget(flr((player.x+8)/8),flr((player.y)/8)) end function _init() player={} player.x=8 player.y=8 player.dx=8 player.dy=8 solid={} solid.di=0 solid.df=0 solid.ui=0 solid.uf=0 solid.li=0 solid.lf=0 solid.ri=0 solid.rf=0 cel_x=0 cel_y=0 tile=0 readmap() end |


I guess this is as "done" as it's going to get, it's playable so that's good!
Made this in a couple of hours about a day trying to learn Lua and to get my OO brain around making things like this
Hopefully I'll revisit it once I'm better and make it decent, but for now I'm happy with it as my first tiny PICO-8 project
(I honestly have no clue what the icons are - they all started off trying to be something like a gem but I quickly realised that I can't do much in 8x8 pixels)
My highest score's 424, what's yours?

