So, i am trying to make simple js game, where you have to shoot some objects. Direction of the bullet should change on wheel (as my arrow). But i dont understand how to do it. Please help
https://codepen.io/mihail-klimchen/pen/PoboaoY
The direction is controlled in the constructor for Ball with:
this.dx = 2;
this.dy = -2;
You will need to pass the values when you instantiate the ball. You will have to do a little trig based on the angle set by the wheel.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.