Jump to content

Collision not detected when manually moving sprite


ManBoy
 Share

Recommended Posts

I am creating a breakout game, basically similar to the one in the example.

http://phaser.io/examples/v2/games/breakout

 

I'm using arcade physics and I have a sprite called 'Thunder' that will fall down by changing the y velocity.

 

Like the example game, the paddle is moved by following the mouse position

this.player.x = this.game.input.x;

Now the thunder that is falling down can be detected if it hits by falling down to the player (paddle). 

*Thunder*    |    |                             COLLISION HAPPENS    v*Player*

However, if the player is moving towards the falling thunder via mouse, the collision doesn't happen.

                 |                 |                  NO COLLISION                 v*Player* ---> *Thunder*

It was working both ways previously when I was using Phaser 1.1.6. Now I'm upgrading to 2.4.2 and for some reason the collision isn't detected anymore. Any idea why?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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