Small AS3 game engine
Friday, January 11th, 2008Initiated by our Christmas Devjam I am currently developing a small game engine in ActionScript 3 in my spare time. The aim is to create a setup that allows quick and easy development of casual games in Flash. The animation system, that I just successfully debugged, is based on the idea of checking the current frame label of the animated MovieClip as described by Jens Franke in this post (make sure to read the comments, too).
This technique completely separates code from design, allowing the designer to delimit animations without writing a single line of code, but by simply placing one label (e.g. “jump”) at the beginning of the animation and one at the end of it ( e.g. “done_jump” ).
So on each frame that starts with “done_”, the engine triggers a method that decides what to do next: play another animation? Loop this animation a certain amount of times? Jump to another animation? Destroy the object? … So, all the programmer has to do is override the function that makes these decisions and implement the coherent animation functions. Easy, isn’t it?
Right now, I’m planning to somewhat opensource the engine, once it’s done - and it doesn’t turn out to be a heap of useless code. As soon as I make progress in this, I’ll let you know.


