Here is just a weird lighting platformer thing I made a while ago, not much of a game.
Some jump noises would be nice, but the code is very impressive.
EnzoGray, you commented out drawing sprite 32 (the white character) in your original code.
I'm pretty sure there are more code optimizations that can be done but I don't know enough about Lua to be able to start theorizing about it much at the moment.
In general you want to avoid creating/destroying objects as much as possible (reuse is generally more efficient), lookup tables can be faster than raw calculation at the cost of memory (in this case I don't think there is enough calcuations to warrant it), short-circuit multiple chained if/and/or statements with the condition most likely to occur first, also if you're absolutely certain variables won't change then you can hardcode them (as that is quicker than looking them up).
I did a couple of minor changes and bumped the max number of pixels up to 400 so there is still room for more.
[Please log in to post a comment]