TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Java.. How to make an object move parabolically?

Page: 1 Reply
Apr 27th 2003#101242 Report
Member since: Apr 22nd 2003
Posts: 11
I have an object moving in a rectangular path.. When it hits each corner of the screen, it moves 90 degrees as a turn.. Im wondering how to make it turn in a CURVE instead of 90 degrees.. Ive been told to use Math.sin or Math.cos but I dont know how that will help me.. Can anyone help me?
Reply with Quote Reply
May 1st 2003#101751 Report
Member since: Apr 20th 2002
Posts: 3000
Can you rephase what you mean by moving 90 degrees as a turn; degrees is a change in direction not a change in position.

Math.cos or Math.sin would work if the path the object takes is governed by a mathematical equation, then again a sin or cos curve won't give you a compete 90 degree turn. Your best bet is to have it rotate x number of degrees, move forward a y amount of units and repeat it until all the x's add up to 90. Getting x and y would be trial-and-error.
Reply with Quote Reply
May 1st 2003#101763 Report
Member since: Apr 22nd 2003
Posts: 11
I think you dont quite understand me.. Right now, the object is turning 90 degrees when it hits a corner.. When the object, moving right, hits the edge of the screen, it goes up, that's a 90 degree turn.. What I want it to do is to go from left to right, but NOT do a 90 degree turn, I want it to gradually curve up like half a parabola, making a smooth turn, not a rigid 90 degree turn.. Can anyone show me the syntax?
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum