Results 1 to 9 of 9
  1. #1
    Thomask is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default Moving 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!

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,691
    Rep Power
    8

    Default

    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.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Thomask is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default

    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!

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,691
    Rep Power
    8

    Default

    Okay... so use some basic trig to figure out where the figure should be, given a center point, a radius, and an angle.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Thomask is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default

    yes, though i need some help for the angle and the radius, can you help me with those?

    kind regards thomas.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    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.

  7. #7
    Thomask is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default

    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.

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    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.

  9. #9
    Thomask is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

Similar Threads

  1. code for moving objects at same time
    By Muhammad Assad in forum New To Java
    Replies: 13
    Last Post: 06-20-2010, 05:11 PM
  2. Moving objects
    By rsjava24 in forum AWT / Swing
    Replies: 1
    Last Post: 02-26-2010, 10:47 AM
  3. help on motion detection
    By MarkWilson in forum Advanced Java
    Replies: 4
    Last Post: 12-07-2009, 06:45 AM
  4. Moving objects - setting different speed
    By Antigol in forum Java 2D
    Replies: 2
    Last Post: 08-14-2009, 01:14 AM
  5. examples of moving objects
    By fred in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •