Game Development with picio-8 Book
start your game development journey
You want to learn to make your first game? Game Development with Pico-8 walks you through making your first game. In this book you’ll be introduced to Pico-8, learn the Lua programming language and the get insight on Game Design.
You’ll get explanations for the code and design choices that are made so you can take these lessons into your next game. In this book we’ll create an infinite runner that tests your skills as you try to set the high score.
After that, there’s bonus content that talks about where to go after your first game to continue your game development journey and get you ready for your first Game Jam!
BUY A COPY
Resources for Game Development with Pico-8
Here are some extra supplemental material for the book that are explained better with a little video.
Box Collision Algorithm
This section is an explanation of the Box Collision algorithm in the book. Below you will find the overlap function used. Below that is a video explanation. To the right you will see the Pico-8 demo that demonstrates the algorithm.
function overlap(a,b)
test1 = flr(a.x) > flr(b.x + b.w – 1)
test2 = flr(a.y) > flr(b.y + b.h – 1)
test3 = flr(a.x + a.w – 1) < flr(b.x)
test4 = flr(a.y + a.h – 1) < flr(b.y)
return not (test1 or test2 or test3 or test4)
end
Copy Table Function
This section includes the second function, copytable that takes an existing table and returns a copy of it. The explanation is a little more in depth so I go over it and go through a demonstration below.
To the right is the example table I use in the video.
function copytable(from)
local type = type(from)
local copy
if type == ‘table’ then
copy = {}
for k, v in pairs(from) do
copy[k] = copytable(v)
end
else
return from
end
return copy
end