Log In  

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

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.

P#36161 2017-01-20 21:58 ( Edited 2017-07-06 01:43)

This is extremely great, thanks so much for sharing!

P#41626 2017-06-14 22:07 ( Edited 2017-06-15 02:07)

thanks for this!

P#41695 2017-06-16 15:19 ( Edited 2017-06-16 19:19)

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.

P#41993 2017-06-29 03:06 ( Edited 2017-06-29 07:06)

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

P#41998 2017-06-29 05:55 ( Edited 2017-06-29 09:55)

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.

P#42006 2017-06-29 10:23 ( Edited 2017-06-29 14:23)

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

P#42007 2017-06-29 10:24 ( Edited 2017-06-29 14:24)

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.

P#42217 2017-07-05 21:43 ( Edited 2017-07-06 01:43)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-10-04 15:49:17 | 0.017s | Q:23