Skip to content

Instantly share code, notes, and snippets.

@cgack
Created September 30, 2012 15:54
Show Gist options
  • Save cgack/3807243 to your computer and use it in GitHub Desktop.
Save cgack/3807243 to your computer and use it in GitHub Desktop.
libpx snippet
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