At some point I knew that the challenges of writing new code to render sprites would give way to good old game logic. That time has come.
I have recently started to consider all possibilities with my sprite and spritesheet classes.
Such things as which frames to use for Attack and Death. I want as many on-screen objects as possible to be animated rather than just a simple flicker on and off. Such things as muzzleflashes needn’t be lengthy affairs but death frames always work best when they are stretched a little.
I also want to be able to leave the corpses in place on the canvas and possibly continue the collision detection beyond sprite death to include blooded footprints after a corpse is crossed. Depends on performance but I wouldn’t imagine it’ll make much difference.
The good thing here is that I’m not actually writing new code. I have numerous functions at my disposal for detecting collision and skipping through frames. Where the syntax for drawing is slightly different the logic is the same.
As anyone who has read my blog before will know I don’t use libraries. They kill my interest stone dead. But I do make a point of reusing my code liberally. For me much of the fun is in crafting and assembling new functions and classes to fit the purpose of the game. Now that I am faced with a different approach to making browser games I am enjoying the new look of my code.
Something that is at my disposal which I am enjoying a great deal is the ability to work with sprite sheets. Splicing all animation frames together to a single .png file and then programmatically selecting the frames to display based on a situation is truly wonderful. As is rotation. Those two features alone have cemented my commitment to producing games using this new technology in the future.
See the latest code in action here: www.wilfscorner.co.uk/sandpit/1/zombiedeath.php