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.
Loving this, incredibly helpful, cool format. Did anyone else get a runtime error <EOF> "attempt to index local 's' (a nil value)" after doing collision 3? It references the 's' in the abs_box, coll, and _update functions. Having a hard time finding my mistake.
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,127) end --(127 for a pixel, 120 for a simple sprite) more generally ship.x=mid(0,ship.x+dx,127)
@codyloyd: Love the changes, And that soundtrack has chops. <3
The shot spread was a nice touch too, As was the star warp effect.
Posting what I got so far from my own tinkering with it here:
Still lots to do from cleaning up my collision routines onwards but I'm just happy I found the single missing letter that had my collision routines not working as intended. (The joys of late night programming.. X.x)
I like my energy bar. It was originally going to count from 1 to 100 but I ended up going with 1-10.
Here's the source for each step: https://github.com/ztiromoritz/pico-8-shooter/tree/master/p8
How do you increase the enemies that spawn? I'm talking about the game made with the tutorial. I'm trying to make a difficulty progression but I can't identify which variable or line of code controls how many enemies spawn. All I need is the variable or line of code that controls the enemies spawn and what I need to change to increase the enemy spawn.
I think it’s this one: https://github.com/ztiromoritz/pico-8-shooter/blob/master/p8/tut_16.p8#L34
I searched for 'enemies' and found this 'respawn' function.
I followed the gifs and found that I learned a lot from them. Especially the collision system seems like a very neat and rigid way of doing things. I added a small function for drawing the collision boxes as well that helped me visualise some of the syntax errors I was having.
One thing that I did find annoying was the lack of scrubbing on gifs. Sometimes I needed to see a part for a bit longer and it was annoying to have to wait for the whole gif to repeat. I ended up downloading all fo the gifs when I was halfway through and making an mp4 out of them all stitched together for the ease of use.
Thank you so much tho! I really appriciate this :)
[Please log in to post a comment]