I did a spaceshooter and documented the process in 16 gifs.
Wow, this really was pretty cool! :D
Thanks for sharing, this is sure to help me (not only me) to learn more.
If you do not mind I joined the gifs in a video.
(Sorry for the English and Hello from Brazil!)
This was really helpful for me. As a pico-8/lua/gamedev noob, I decided to hand copy the code from the gifs, looking up stuff in the pico-8.txt doc as I went along. I learned a bunch, thanks!
I love how the overlay for each gif is each of the colors in the pico-8 palette.
:: Restricting ship to screen area
This is some quick and dirty code to restrict ship to screen area
if btn(0) then if ship.x==0 then ship.x=128 else ship.x-=1 end end if btn(1) then if ship.x==128 then ship.x=0 else ship.x+=1 end end if btn(2) then if ship.y==0 then ship.y=0 else ship.y-=1 end end if btn(3) then if ship.y==120 then ship.y=120 else ship.y+=1 end end
--wrap around if btn(0) then ship.x=(ship.x+127)%128 end if btn(1) then ship.x=(ship.x+1)%128 end more generally, ship.x=(ship.x+128+dx)%128 --walls if btn(0) then ship.x=max(0,ship.x-1) end if btn(1) then ship.x=min(ship.x+1,128) end more generally ship.x=mid(0,ship.x+dx,128)
Log in to post a comment