Log In  

Hi PICO-8 community! My name is Jay and I've been a PICO-8 fan for a long time and I wanted to gauge interest in a book I'm writing. The book takes you through the journey of creating a whole game using PICO-8. I start you from scratch and not only shows you the code, but I walk you through it with explanations and pictures. I also discuss design, game development process, offer insights and take you through the journey of making a game. I've attached a 3 page excerpt from my book so far and wanted to get thoughts from everyone. My goal is to teach you to make a game by walking you through one. I hope to give you an appreciation for game creation and in the process you learn something about design, art and code.

A year ago I wanted to clone one of my favorite arcade games Defender. Except that I had the idea of documenting what I did the whole time. It took a while but I have a stack of notes of not only the creation of it, but the design exercises of why things are they way they are and justifying the order of each feature. After I finished, I realized that I could write a book that walks you through the whole thing. I've written 5 chapters so far and I'm estimating how much work it would be to finish and thinking about if anyone would find it useful or interesting.

If you had a book like this, what would you want or expect from it?

A 4 page excerpt of what I'm thinking:

Gif of the final game:

Thanks in advance!

P#66668 2019-08-14 07:07 ( Edited 2019-08-14 07:18)

A zero-to-Defender book certainly makes sense.
Does your game touch on the map? (not obvious for such game) but would be a big gap in a pico8 book.
Do you plan to have advanced chapters, like sfx manipulation via poke or shading via peek/poke?

Coding style comment: you introduced the table in the chapter, yet youvare using the dot notation directly.
This is actually called a dictionary/hash map in a standard CS littérature.
May be the standard syntax could be clearer for noobs:


Note the table is also very close to the value vs reference concept, something that most would-be gamedev have a lot of difficulty to grasp.
Do you plan a chapter on that?

Good luck!

P#66670 2019-08-14 07:39 ( Edited 2019-08-14 07:41)


Yes I would do all of it including the radar. The book is targeted to everyone including beginners. Whether you can absorb all of it or have to just follow along I am explaining everything along the way.

Thanks for the comment on the notation. I start out being explicit so that there is no ambiguity for what’s going on for beginners. Then I introduce other notation as you describe.

As far as value vs reference concepts I try to teach them by example and show them the rules for how it works without going too far into the weeds. I am not expecting this to be a whole CS course. What I am expecting is that it will prime any new comer to then pursue programming and game making.

I’ve done research and learned that clear ideas are more useful than “right” ideas. For example, we all learn in elementary school that electrons “orbit” nuclei in atoms like planets orbit the sun. This is useful enough to have a discussion about matter but it’s wrong. Electrons move in probability clouds. But probability clouds is not useful to learn for non-physicists. So the solar model works fine. Im doing the same by explaining the mechanics of how it works without wading too deep into CS theory. I’m trying to be as simple as possible and I’m finding that to still be hard but not impossible. There are times where I think I need the user to just come along and type in a helper function and I don’t expect them to understand it, but I expect them to learn what it does and use it. That make sense? A tree this book, they can take their basic understanding and learn how it really works. Learn about probability clouds

P#66671 2019-08-14 07:57 ( Edited 2019-08-14 08:02)

Makes sense - looking forward for a hardcover print at my local library!

P#66675 2019-08-14 09:45
:: Felice

@freds72, when you asked about the map, did you mean the PICO-8 tile map, or the radar in the game?

I ask because I think @MasterHyjinx read it as the radar, while you meant the PICO-8 tile map.

P#66678 2019-08-14 18:29

I did mean the built-in pico tile map - yeah!

P#66680 2019-08-14 19:21 ( Edited 2019-08-14 19:28)

@Felice @freds72, Ah, you are correct I did misread that. I decided to not use the map. Instead I went for procedurally generating the terrain and walk the reader through a simple algorithm to do it. The way I was thinking about it, was that the topics go too far and too wide and I wanted to constrain the tools and what was needed to build. So therefore cloning an arcade game is a good idea. If this book ends up being worthwhile, then I already sketched out a second book that does a platformer that walks the user through that and makes extensive use of the map tool.

P#66682 2019-08-14 19:34

As a total beginner i couldn't be more interested! Looking forward to it!

P#73056 2020-02-13 09:16

That sounds like a great book! I kinda want to get a copy for my dad - he loved Defender in his youth and he was interested in learning more about PICO-8.

Awkward question: I think PICO-8 Lua variables are global by default? In the snippet, you talk about initializing a variable outside all the functions to make it global, but I've never had to do that. More the reverse - I've had to explicitly declare them local to make them not global.

That said: hope the build and the book go really really well!

P#73063 2020-02-13 13:16
:: dw817

I'm just waiting for when this great game of DEFENDER for Pico-8 is coming out so I can play it ... !

P#73090 2020-02-14 04:53 ( Edited 2020-02-14 04:53)
:: sparr

While I don't expect a book like this to be targeted at people like me, I'd love to read it, and to help proof and make suggestions if you'd like.

P#73094 2020-02-14 07:40

Little bit of an update. I explored an opportunity to develop a prototype with a possible publishing deal for a few months at the end of last year, but it fell through. I bought a Macbook to use better software for writing it and set up a more efficient pipeline to get code formatted into the book. I'm in chapter 9 and I'm having to expand explanations and as always it's more work than I thought haha but I'm still working on it. After I wrap up a project this week I'm back to it.

@packbat You are correct. If you declare them without the local keyword, they are global. I'm choosing in and out of functions as a spatial difference so the newbie can learn where goes where. One thing I'm learning about writing this is that I have to tell "half truths". Where you explain it one way that works just so the user gets the idea. If I did a more complex explanation, it would confuse the reader. For example, we all learn in school that electrons orbit atoms right? That explanation lets us talk about matter, mass and reactions. However, it's not true. Electron movement in the space around the atom is more accurately described as a probability cloud. Talking to grade school children about probability clouds it's useful. However, since you are correct I'll either change my mind or that or add it to the "Side Note" section where I actually go further in depth on what's really going on. I am adding bits to the book for those that are curious or want to know more.

I'm also re-writing little parts of the game again just because otherwise they're really difficult to explain. I just had to write a section I call "Magic Numbers" because they control an algorithm and just trust that I'm giving them to you through research. I tie this idea to how long game makers spend just playing with their models in their game to get them to work and encourage the reader to play with them. The book isn't just how to program the game and why, but I talk about it as a journey of making a game.

I'm ALSO writing little programs to provide explanations. I just wrapped up writing a separate program to actually illustrate overlaps >_< because it didn't feel right to just put:

function overlap(a,b)
test1 = flr(a.x) > flr(b.x + b.w)
test2 = flr(a.y) > flr(b.y + b.h)
test3 = flr(a.x + a.w) < flr(b.x)
test4 = flr(a.y + a.h) < flr(b.y)
return not (test1 or test2 or test3 or test4)

and say trust me, it works. So that's that! Glad this thread got a few responses. It gets me amped to get back to it!

P#73518 2020-02-27 21:45

Crazy but I was trying to do the same thing before I read this discussion. Only it was going to be from a learners perspective. I would walk you through literally each line of the code explaining each function and what the line was meant to do. It was going to have an exhaustive glossary and index of each function used. But this is cooler because I won't have to do anything.Leans back in desk chair and starts to sip lemonade

P#73526 2020-02-28 00:42

Heh, I just read the page, your doing the exact same thing but without the Glossary and Index. I think what we really need is a compiled Dummy's Guide to Pico-8 for people who are dummies i.e. Me.

P#73527 2020-02-28 00:45

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2020-08-08 07:11 | 0.064s | 4194k | Q:44