Hello guys!

Today i decided to make a game in a java applet, now i got stuck with a problem, how can i move an object in an circulair motion?

thanks in advance!

Printable View

- 02-17-2011, 04:44 PMThomaskMoving Objects in an circlelair motion.
Hello guys!

Today i decided to make a game in a java applet, now i got stuck with a problem, how can i move an object in an circulair motion?

thanks in advance! - 02-17-2011, 04:46 PMKevinWorkman
That really depends on a lot of things. How are you doing the movement (setting xSpeed and ySpeed, setting speed and direction, using interpolation, something else)?

But some basic trig is probably the way I would go. SOHCAHTOA, baby. - 02-17-2011, 04:48 PMThomask
well, i am using an Java Image, that moves, the speed i'd like to go is about 1.5 coordinates each time.

thanks in advance! - 02-17-2011, 05:22 PMKevinWorkman
Okay... so use some basic trig to figure out where the figure should be, given a center point, a radius, and an angle.

- 02-17-2011, 05:23 PMThomask
yes, though i need some help for the angle and the radius, can you help me with those?

kind regards thomas. - 02-17-2011, 06:12 PMFubarable
I second Kevin's recommendation: use basic trigonometry, then if you are stuck on a specific problem, please feel free to come back with the problem. You are more than welcome to show a little initiative here.

- 02-17-2011, 06:15 PMThomask
well, i have read alot of ways to do it, BUT i havn't even passed that in school, i just see those cos and sin methods in how-to's but yet i can;t really find a way, can anyone help me with this, cause i don't really know what cos and sin is , ofcourse you might call me stupid, but i am not posting this for no reason.

kind regards thomas. - 02-17-2011, 06:23 PMFubarable
No one's calling your stupid, but we have yet to see the fruits of your efforts. If you don't understand sin and cos, you need to fix this before you can try to program with them. You can find some information here: Trigonometric_functions, and in other tutorials on the web.

Luck. - 02-17-2011, 06:23 PMThomask
thanks , ill take a look at that.