fd neko
Key RequiredUniversal

fd neko

Universal Scriptnicn1202ffnicn1202ff 89.9K views 5.3K executesUpdated Oct 31, 2023
0.0/ 5(1 votes)
010% Positive
Lua Script•80 lines (2488 chars)
//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: function()
		{
			this.Class.nekoAnim=new Image();
			this.Class.nekoAnim.onload = this.handleImageLoad;
    		this.Class.nekoAnim.onerror = this.handleImageError;
			this.Class.nekoAnim.src= 'img/MonsterARun.png';
			console.log(this);
		},

		handleImageLoad: function(e)
		{
			console.log(this);
			this.Class.spriteSheet = new createjs.SpriteSheet({
			    // image to use
			    images: [this], 
			    // width, height & registration point of each sprite
			    frames: { width: 64, height: 64, regX: 32, regY: 32 }, 
			    // To slow down the animation loop of the sprite, we set the frequency to 4 to slow down by a 4x factor
			    animations: {
			        walk: [0, 9, "walk", 4]
			    }
			});		

			// to save file size, the loaded sprite sheet only includes left facing animations
			// we could flip the display objects with scaleX=-1, but this is expensive in most browsers
			// instead, we generate a new sprite sheet which includes the flipped animations
		    createjs.SpriteSheetUtils.addFlippedFrames(spriteSheet, true, false, false);				// create a BitmapSequence instance to display and play back the sprite sheet:
			this.Class.bmpAnimation = new createjs.BitmapAnimation(spriteSheet);
			// set the registration point (the point it will be positioned and rotated around)
			// to the center of the frame dimensions:
			this.Class.bmpAnimation.regX = this.Class.bmpAnimation.spriteSheet.frameWidth/2|0;
			this.Class.bmpAnimation.regY = this.Class.bmpAnimation.spriteSheet.frameHeight / 2 | 0;
		    // start playing the first sequence:
		    // walk_h has been generated by addFlippedFrames and
		    // contained the right facing animations
			this.Class.bmpAnimation.gotoAndPlay("walk_h"); 	//walking from left to right
			this.Class.bmpAnimation.name = "monster1";
			this.Class.bmpAnimation.direction = 90;
			this.Class.bmpAnimation.vX = 1;
			this.Class.bmpAnimation.x = 16;
			this.Class.bmpAnimation.y = 32;
			// have each monster start at a specific frame
			this.Class.bmpAnimation.currentFrame = 10;
			stage.addChild(bmpAnimation);		
		},

		handleImageError: function(e)
		{
			
		},

		throwShuriken: function()
		{
			
		}
	});


function tick() {

    stage.update();
}

Features & Information

good

Community Comments (4)

swagswagNov 1, 2023(edited)

this is in js??

emrysthecatsmeowemrysthecatsmeowNov 20, 2024(edited)

richie what?

BRAWLLLBRAWLLLJan 27, 2025(edited)

not working..

cataldomacielcataldomacielJan 14, 2026

not working man

More Scripts for Universal Scripts