Tuesday 16 August 2011

The Old New Way


I'm sure I'm not the first programmer to look at my code that I wrote years ago, and rather than think "what a pile of crap" (as usually happens) but actually "What? I knew how to do that? I wish I still did!".

After writing my own 2D library using "nodes" and "spatials" (inspired by the "simplicity" of jMonkeyEngine) it turned out that it wasn't the most efficient way to do the graphics. I ended up using a simple 2D array, meaning I could easily calculate which tiles were visible and only draw those. SO now the game runs pretty damn smoothly*, which is a relief.

(* It does on my phone anyway. Other phones may have different levels of performance.)

No comments:

Post a Comment