I wrote Brick Breaker as a full-featured, polished PICO-8 sample program. It was an opportunity for me to learn the PICO-8 Lua variant and now stands as a good example program for other programmers new to PICO-8.
It demonstrates (commented) use of:
- create & destroy objects
- local vars
- multiple levels
- sprite animation
- map usage
- title screen & game over
- sound effects
- sprite packing
- basic physics
as well as some techniques for reducing token count, a limited resource on PICO-8.
For starters, the score is a multiple of ten. Which means one only needs to count the score without the ones place. Internally, the "tens place" is in the ones place, and so on. When you display the score value, just draw a zero next to it. That will at least make the score not overflow until 327670, instead of 32767, which happens pretty quickly. Essentially, 10 game points equals 1 on the internal score variable, so you can represent a score 10-times larger.
[Please log in to post a comment]