Jump to content

Offset grouped animations


minasokoni
 Share

Recommended Posts

Sorry I figured it out. this is what I did:

		for (var i = 0; i < skullPos.length; i++) {			for (var j = 0; j < skullPos[i].length; j++) {				if (skullPos[i][j] == 1) {					var skull = this.skulls.create(0, 0, '01_skull_red');					skull.x = j * (skull.width + (skull.width / 2));					skull.y = i * (skull.height + (skull.height / 2));					skull.animations.add('talk');					skull.animations.play('talk', 60, true);					skull.animations.next(Math.floor(Math.random() * 10) + 1);					this.game.physics.arcade.enable(this.skulls);					this.skulls.enableBody = true;					skull.body.immovable = true;				}			}		}
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...