Skip to content

Instantly share code, notes, and snippets.

@AlexKardone
Created August 26, 2019 14:14
Show Gist options
  • Save AlexKardone/323a5b575a7eeba79a4ef32c8752d100 to your computer and use it in GitHub Desktop.
Save AlexKardone/323a5b575a7eeba79a4ef32c8752d100 to your computer and use it in GitHub Desktop.
Calculate the angle of shooting
shapes.point.x = shapes.point.x + shapes.point.velocity * Math.cos(angle / 180 * Math.PI);
shapes.point.y = shapes.point.y + shapes.point.velocity * Math.sin(angle / 180 * Math.PI);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment