Last active
August 29, 2015 14:19
-
-
Save amadeus/2f2aa6601bcf1052a984 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** nanobot */ | |
var Nanobot = function(game, x, y) { | |
// extends | |
Phaser.Sprite.call(this, game, x * pxr, y * pxr, 'nanobot', 'nanobot-180'); | |
// members | |
this.hoverBase = 6; | |
this.hoverEffect = game.add.tween(this); | |
// defaults | |
this.scale.set(2); | |
this.anchor.set(0.5); | |
} | |
Nanobot.prototype = Object.create(Phaser.Sprite.prototype); | |
Nanobot.prototype.constructor = Nanobot; | |
Phaser.Utils.mixin({ | |
update: function(){ | |
var dt = Phaser.Time.elapsed; | |
this.y += 1; | |
Phaser.Sprite.prototype.update.apply(this, arguments); | |
} | |
}, Nanobot.prototype); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment