Created
September 30, 2012 15:54
-
-
Save cgack/3807243 to your computer and use it in GitHub Desktop.
libpx snippet
This file contains hidden or 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
if (me.game.STATE.weaponState === "magic_torrentacle") { | |
if (this.direction === "west") { | |
magic = new MagicEntity(this.pos.x - 100, this.pos.y + 30 , { image: "magic_torrentacle", spriteheight: 128, spritewidth: 128}); | |
magic.flipX(true); | |
me.game.add(magic, this.z); | |
me.game.sort(); | |
} else if (this.direction === "east") { | |
magic = new MagicEntity(this.pos.x + 42, this.pos.y + 30, { image: "magic_torrentacle", spriteheight: 128, spritewidth: 128 }); | |
me.game.add(magic, this.z); | |
me.game.sort(); | |
} else if (this.direction === "south") { | |
magic = new MagicEntity(this.pos.x - 24 , this.pos.y + 100, { image: "magic_torrentacle", spriteheight: 128, spritewidth: 128 }); | |
me.game.add(magic, this.z); | |
me.game.sort(); | |
} else if (this.direction === "north" ) { | |
magic = new MagicEntity(this.pos.x - 24, this.pos.y - 30, { image: "magic_torrentacle", spriteheight: 128, spritewidth: 128 }); | |
me.game.add(magic, this.z); | |
me.game.sort(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment