Run it
Copy the script and paste it into your executor.
//Neko Class
var NekoNin = gamecore.Base.extend('NekoNin',
{
nekoAnim:'',
bmpAnimation:'',
spriteSheet:''
},
{
hp:1000,
lastFireTime:0,
nekoState : 'nekoIdle',
nekoState2 : 'nekoIdle',
nekoJump : false,
jumpSpeedLimit : 15,
jumpSpeed : 15,
init: ()
{
this.Class.nekoAnim=new ();
this.Class.nekoAnim.onload = this.handleImageLoad;
this.Class.nekoAnim.onerror = this.handleImageError;
this.Class.nekoAnim.src= ;
console.(this);
},
handleImageLoad: (e)
{
console.(this);
this.Class.spriteSheet = new createjs.({
// image to use
images: [this],
// width, height & registration point of each sprite
frames: { width: , height: , regX: , regY: },
// To slow down the animation loop of the sprite, we set the frequency to to slow down by a x factor
animations: {
walk: [, , , ]
}
});
// to save file size, the loaded sprite sheet only includes left facing animations
// we could flip the display objects with scaleX=-, but this is expensive most browsers
// instead, we generate a new sprite sheet which includes the flipped animations
createjs.SpriteSheetUtils.(spriteSheet, , , ); // create a BitmapSequence instance to display play back the sprite sheet:
this.Class.bmpAnimation = new createjs.(spriteSheet);
// set the registration (the point it will be positioned rotated around)
// to the center of the frame dimensions:
this.Class.bmpAnimation.regX = this.Class.bmpAnimation.spriteSheet.frameWidth/|;
this.Class.bmpAnimation.regY = this.Class.bmpAnimation.spriteSheet.frameHeight / | ;
// start playing the first sequence:
// walk_h has been generated by addFlippedFrames
// contained the right facing animations
this.Class.bmpAnimation.(); //walking from left to right
this.Class.bmpAnimation.name = ;
this.Class.bmpAnimation.direction = ;
this.Class.bmpAnimation.vX = ;
this.Class.bmpAnimation.x = ;
this.Class.bmpAnimation.y = ;
// have each monster start at a specific frame
this.Class.bmpAnimation.currentFrame = ;
stage.(bmpAnimation);
},
handleImageError: (e)
{
},
throwShuriken: ()
{
}
});
() {
stage.();
}good

Universal