Optimisation


When I built Shark Turtle in 2023 I was concerned about maintaining fast updates and animation, but was aware that most of the time the screen would be static. How to strike the right balance in performance?

Go Slow

My first solution was to come up with a dynamic frame rate system that gave me the best of both worlds:

  • fast frame rate when animation is happening
  • slow frame rate when the user is moving the cursor

This did work, but I abandoned it…for reasons I can’t remember.

Dirty Epic

Instead I manually keep track of the dirty status of the grid and score “HUD” areas of the screen, only redrawing each of them when they have actually changed. So, drawing is frequent drawing animations but if you don’t do anything literally nothing is drawn on the screen.

You can see this in the video above where updated screen areas are highlighted in translucent orange.

With more development time I could make the grid dirty tracking work in columns so that only the changed columns redraw, but it was not to be.

Why?

This all means the game uses very little power most of the time. I put time into optimisations like this because it makes for a better experience for players.

Get Shark Turtle for Playdate

Buy Now$6.00 USD or more