Log In  

Cart #26039 | 2016-07-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I did a spaceshooter and documented the process in 16 gifs.

See an overview of all 16 gifs at once. And start each gif as a step by step tutorial.

P#26040 2016-07-28 16:57 ( Edited 2018-08-29 11:41)

Nice, makes me think I'm over complicating things :-).

P#26041 2016-07-28 17:13 ( Edited 2016-07-28 21:13)

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.

Thanks again
(Sorry for the English and Hello from Brazil!)

P#26065 2016-07-29 01:44 ( Edited 2016-07-29 05:44)

This is a really cool way of providing a tutorial actually. Thanks for sharing!

P#26072 2016-07-29 05:11 ( Edited 2016-07-29 09:11)

Thank you all.

@erloncabral : This is cool. What would you like to do with it? We could add it to the page. Also feel free to use it under (CC BY-NC-SA 4.0) conditions.

P#26105 2016-07-29 17:39 ( Edited 2016-07-29 21:39)

ztiromoritz : Hi, I actually joined the gifs just to give pause in some parts, totally for personal use, it might be useful for some more, and put the link here :)

P#26224 2016-07-31 13:59 ( Edited 2016-07-31 17:59)

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.

P#26614 2016-08-07 00:10 ( Edited 2016-08-07 04:10)

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.

P#32740 2016-11-24 22:32 ( Edited 2016-11-25 03:34)

Really helpful, thanks! It would be nice if you could constrain the ship to the screen -- just unconventional to navigate outside the play field.

P#32999 2016-12-04 03:07 ( Edited 2016-12-04 08:07)

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
P#33409 2016-12-12 15:11 ( Edited 2016-12-12 20:11)

Thanks for sharing, I learned a lot with your tutorial !

P#33411 2016-12-12 15:14 ( Edited 2016-12-12 20:14)

quick tricks:

--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

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)
P#33413 2016-12-12 16:06 ( Edited 2017-09-10 21:44)

Thanks @ultrabrite, I've already put this into use

P#33424 2016-12-13 00:45 ( Edited 2016-12-13 05:45)

Thanks for the inspiration!


P#34755 2017-01-02 14:40 ( Edited 2017-01-02 19:40)

I wanted to thank ztiromoritz for this marvelous tutorial.

Another thing: whatever you write, ultrabrite, should be written in stone!

Pure awesomeness.

P#44055 2017-09-10 14:41 ( Edited 2017-09-10 18:41)

thanks ltpitt, but that would be harder to edit (there was 128 instead of 127 (or 120) in the snippet above) ^_^

P#44066 2017-09-10 17:47 ( Edited 2017-09-10 21:47)

I've been following this tutorial to try and refresh myself with coding and managed to get code in there to make the ship 'tilt' on turns and the stars go to warp between areas. Feels good.

P#44093 2017-09-11 10:59 ( Edited 2017-09-11 14:59)

here's my go at it.. I want to make the enemies a little more interesting... but for now it feels pretty good.


P#44250 2017-09-16 19:14 ( Edited 2017-09-16 23:14)

@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:

Cart #44388 | 2017-09-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

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.

P#44271 2017-09-17 07:38 ( Edited 2017-09-20 12:20)


Cart #44553 | 2017-09-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Working on it a bit more on its own thread in the WIP section, But it's playable as the demo was so far.. Very basic.

P#44555 2017-09-24 14:21 ( Edited 2017-09-24 18:21)

It prints out an error while i was doing collision 3
"attempt to index local 's' (a nil value)", Any ideas why?

P#48769 2018-01-31 03:23 ( Edited 2018-01-31 08:23)

I got the error message "attempt to index local 's' (a nil value)". The message points to abs_box function and coll function, but I implemented these functions exactly as in the tutorial. Could someone give some help?

P#54574 2018-08-01 13:43 ( Edited 2018-08-01 17:43)

Hi guys!
First of all, @ztiromoriz, thanks for your amazing tutorial.
I finished my game based on it. Please, see below


P#55848 2018-08-29 07:41 ( Edited 2018-08-29 11:41)

Is this tutorial completed already?

P#61362 2019-01-30 19:52

This is a great, really helpful tutorial, I learned a lot from it. Whilst stylish, I'm not really sure 16 GIFs that you can't pause or rewind is really the best way of demonstrating code though. It'd be great to just have it set out in a more traditional format.

P#73284 2020-02-20 12:46

@extar It's published under a CC license. Nothing is stopping you from laying the same content out in a more traditional format and publishing your version.

P#73299 2020-02-20 20:56
P#73300 2020-02-20 20:57

Thank you for this!

P#87238 2021-02-05 03:27

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.

P#96709 2021-08-31 04:03

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.

P#96721 2021-08-31 14:39


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 :)

P#102338 2021-12-10 23:03

Yo, thanks for the tutorial. It still works even on more recent versions of Pico-8. <3

P#117602 2022-09-18 04:17

[Please log in to post a comment]