Jump to content

Strange Body Behaviour


Miroku_87
 Share

Recommended Posts

Hey everyone I've got a strange issue with my game.

I'm using Phaser for the first time and I'm trying to recreate Space Invaders as a training. 

I'm now developing the killing of the aliens by the player.

 

On the world I've got a group containing other groups which are the rows of aliens.

Since I can't collide nested groups with self or other groups I made a collision between an array of Alien instances and a group of projectiles.

 

You can see all of my code here:

https://github.com/Miroku87/phaser-invaders

 

Unfortunately I find a strange behaviour while the alien rows moves (with the help of a time loop).

As you'll see in the video I'm linking below, before one row of aliens moves there's a fraction of second in which all of their bodies are in the left top corner and it's not just a debug render problem because if I shoot at that point I actually kill some alien.

Maybe it's a preUpdate issue? I just don't know .__.

 

Here the video:

https://db.tt/hTLsWHJg

 

I hope someone will be able to give me some suggestion on where to look to fix this.

Thank you in advance!

 

EDIT:

Interested lines could be 

https://github.com/Miroku87/phaser-invaders/blob/master/src/states/Game.js#L57

https://github.com/Miroku87/phaser-invaders/blob/master/src/agents/AlienGroup.js#L40

Edited by Miroku_87
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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