I am trying to move a player in direction angle by speed. I need to use trigonometric functions in order to calculate this. Can anyone help me discover how to do this?
if (playerB.up == true) {
(playerB.speed)+=((Delta*ballspeed)/1000);
}
if (playerB.down == true) {
(playerB.speed)-=((Delta*ballspeed)/1000);
}
if (playerB.left == true) {
(playerB.angle)-=((Delta*ballspeed)/1000);
}
if (playerB.right == true) {
(playerB.angle)+=((Delta*ballspeed)/1000);
}
//move player in direction angle by speed