So this may be a fairly simple question, however I've been writing this code for over 8 hours so my brain is slightly pooped. Basically, I have a frame that looks like this: (https://i.stack.imgur.com/YkbD1.jpg)
If you'll excuse my crude drawing, I was wondering about the maths. Given the angle theta, what I want to do is, given a specific Point object, that will be the bullet I shoot, how do I adjust the x/y coordinates in parallel to move along that given angle? There is a window size of 700x500 inside the JFrame. I'll post the code in a pastebin if it is quite necessary but I felt that this question was purely arithmetic (sin/cos/tan) related.
Basically I have this:
if(pinballAngle > 90){
pinballCoordinate.x+=(pinballAngle/3);
pinballCoordinate.y-=20;
}
else if(pinballAngle < 90){
pinballCoordinate.x+=(pinballAngle/3);
pinballCoordinate.y-=20;
}
else{
pinballCoordinate.y-=20;
}
So pinballCoordinate is the Point object that I am trying to adjust given the angle of theta, that is the 'gun' that shoots the pinball. The 'pinballAngle' variable is the angle of the gun.