Log In  


Cart #36160 | 2017-01-21 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
17

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:

  • loops
  • create & destroy objects
  • local vars
  • text
  • multiple levels
  • sprite animation
  • powerups
  • particles
  • map usage
  • title screen & game over
  • sound effects
  • music
  • sprite packing
  • basic physics
  • assertions

as well as some techniques for reducing token count, a limited resource on PICO-8.

I did most of this work in parallel with the 2017 Global Game Jam. The PICO-8 version of Brick Breaker is based on my JavaScript Brick Breaker sample program, which you can play here.

17


This is extremely great, thanks so much for sharing!


thanks for this!


Great game! Just an observation: my score goes negative pretty easily. You should consider splitting the score into two 16-bit values, high-order and low-order.


@phiber - Is this to cope with the number limit for variables? Can you explain how to do this?


You could also use more bits by adding 2^-15 for each point (instead of 1), then multiplying the score value by 2^15 for display.


I guess you still need to handle overflow on that multiplication, though, hmm!


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]