This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- In RGB displays, each pixel contains 3 subpixels for red, green and blue. | |
| -- The intensity of each subpixel can be changed independently. | |
| -- Mixing different intensities of each allows for a large range of colors. | |
| -- In this program, we'll use a similar approach. | |
| -- Except our RGB subpixels can only be on or off, which limits us to 8 colors. | |
| -- We can treat a PICO-8 color index like an RGB pixel by treating the first 3 | |
| -- bits as flags for each RGB subpixel. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- | |
| -- draws a sprite to the screen with an outline of the specified colour | |
| -- | |
| function outline_sprite(n,col_outline,x,y,w,h,flip_x,flip_y) | |
| -- reset palette to black | |
| for c=1,15 do | |
| pal(c,col_outline) | |
| end | |
| -- draw outline | |
| for xx=-1,1 do |