Log In  

Cart #lightingdemothing-0 | 2020-04-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

Here is just a weird lighting platformer thing I made a while ago, not much of a game.

P#75449 2020-04-26 21:39

2

I played around a bit with the code, particularly PC, _draw, and _update functions and took it from about 220 pixels max on my machine to about 360 pixels before the performance dropped.

Cart #zebutisezo-0 | 2020-05-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

P#75696 2020-05-01 15:51
1

Some jump noises would be nice, but the code is very impressive.

P#75705 2020-05-01 19:28

Thanks RyanC! I'm very impressed on how you optimized this. I had originally thought that what I had done was about as much as Pico-8 could take. Also, I don't know why there isn't a character in mine, honestly...

P#75754 2020-05-02 21:09 ( Edited 2020-05-02 21:12)
2

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.

P#75813 2020-05-04 23:10 ( Edited 2020-05-04 23:24)

When I read that I was working on a sand-dropper thing that could really use some optimization, I'm gonna try implementing some of those techniques.

P#76457 2020-05-12 18:56

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 07:23:17 | 0.013s | Q:27