Log In  


Please help me understand how screens are drawn in Pico-8. When I first started playing, I thought sprites would be like player missile graphics on my Atari, but it doesn't look like that's the case. It looks like I clear/redraw everything on the screen with the _draw() function. Is that correct?



You have basicly two way of rendering your game. In the first you doesnt clear each frame (so no cls() in the _draw() function) and you draw your new points/lines/sprites on top of what was here the last frame. This is prety usefull for some special effect's in graphical demo, or in simple game like LightCycle, where you even use the screen as the state of your game. By drawing each frame, you create a maze, and you read the pixel value to see if there is collision.
In the second way of rendering, you clear everything each frame, and need to redraw everything in the _draw() function. This is the standard in most sprite heavy games, like plateformer's. In this method, you can easily use scrolling (with camera() function).
You can sometimes mix the two ways, like in the Shodo cartridge, where you keep the last frame, but can also draw some sprite on top of it that will last only one frame. This way is a lot more trickier.


Ok, that makes sense! Thanks!



[Please log in to post a comment]