Jump to content

Continue moving body in same direction of clicked point ?


prateek.pradeep
 Share

Recommended Posts

Hi,

I want my body to move continuously in player clicked direction. I am able to achieve it by this

 

this.bird.rotation = this.game.physics.moveToPointer(this.bird, 300, this.game.input.activePointer, 0); 

 

But once the body reaches the active input point it start to vibrate randomly around the active Input point.

I want my body to continue moving in the same direction, go beyond the input point and hit the boundary.

 

How do i do this??

Link to comment
Share on other sites

the bird keeps on vibrating once it reaches the click point. That was the problem.

Anyways i solved it my self. This is what i did

 

on click of mouse

 

onClick()

{

game.physics.arcade.moveToPointer(bullet, 300);

}

 

and in update method

 

update()

{

this.bird.body.velocity = this.bird.body.velocity;

}

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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