ads

Monday 27 December 2010

Browser Based 2D fighting game - Part 2



Things getting developed much more as I started digging into this framework. The framework is pretty easy to handle.When you define an animation and register it, it will start animation when you load it in Browser.Another beauty of this framework is , you do not have to write lot of code to initialize and register an animation. A small piece of code like this will kick of animation!. This was pretty easy.

var abobo = {
        currentState : IDLE,
        oldState:0,
        position: 400,
        adversary: "#cvs",
        animations: [
        {animation: new $.gameQuery.Animation({    imageURL: "./img/forgame/14657-14670-idle.png",
                                    numberOfFrame: 13, delta: 368, rate: 250,
                type: $.gameQuery.ANIMATION_HORIZONTAL | $.gameQuery.ANIMATION_CALLBACK}),
                  deltaX: 0, deltaY: 0, width: 468, height: 240}]};

The only thing you need to know is some background about sprite based animations and what are these parameters related to.

No comments:

Post a Comment