 |
 |

07-04-2001, 09:07 AM
|
|
|
Implimenting momentom ??
|
Hey I am making a boat game (captain cook style)
anyway I want it so when I turn I want the ship to use the current speed to calculate how long it will take to turn right around.
I was thinking of using the circle command and make the boat follow that and have the size of the circle to be compensated for the current speed of the boat, but I dont know how to make this all work..
is gettin the degrees for the circle possible?
~
|
|

07-04-2001, 09:38 AM
|
|
Senior Contributor
Retired Moderator * Expert *
|
|
Join Date: Feb 2001
Location: UK
Posts: 1,287
|
|
Re: Implimenting momentom ??
|
off the top of my head
you could perhaps use 2 timers, when you turn in a new direction instead of just turning off the first timer you could decrease its movement until it reaches 0 ie
set x to 50
in timer1
<pre>imgBoat.left=img.Boat.left+x</pre>in timer2<pre>imgBoat.top=imgBoat.top+y
x=x - 5</pre>obviously this doesn't cater for all your movents, but with select case in each timer for all directions it may give a nice drift effect
just toggle between timers each time you press a new direction and remember to reset x and y
|
|

07-26-2001, 11:04 AM
|
|
Junior Contributor
* Expert *
|
|
Join Date: Jul 2001
Location: Lake Forest, CA
Posts: 393
|
|
Re: Implimenting momentom ??
|
Another thing you could try is to have two variables: XVelocity and YVelocity, which indicate how fast an object is travelling in the two dimensions.
When you turn and thrust in a different direction, don't immediately have the object start going in that direction; gradually change the XVelocity and YVelocity variables so that they align themselves to the new direction.
When you move your object, don't simply change x and y according to the direction the object is facing, but change x and y according to the XVelocity and YVelocity variables.
I hope this helps...
<P ID="edit"><FONT class="small"><EM>Edited by Teric on 07/26/01 12:04 PM.</EM></FONT></P>
|
__________________
I am always open to feedback, positive or negative...
|

07-29-2001, 08:55 AM
|
|
|
Re: Implimenting momentom ??
|
yea i realise this when i made a pingpong game
what i did was have ball =ball +x
and the x was define from where it hit the bat surface, the middle of the bat was 0 and going left would be -1,-2-3 etc and going right 1,2,3 etc
~
|
|

07-30-2001, 09:32 PM
|
|
|
Re: Implimenting momentom ??
|
could this be implemented in a car game so that the movement would be somewhat realistic? i mean the drifting effect..would it be very noticable.
|
|

07-31-2001, 01:39 AM
|
|
|
Re: Implimenting momentom ??
|
Physics is the basis for realism in all games. Each situation has differnt circumstances..
for example, in a car game, you have the force of the car going sideways being counteracted by the friction of the tires against the pavement. But, since the forces are acting at a distance, a rotation moment is created [tipping]. You could make your game complicated enough such that it calculates this... then, you balance your moment out with the weight of the car, and if a moment still exists, *flip*... a class [or textbook] in statics would be a good place to start for designing such a creature. As realism is increased, more and more advanced and exact variables must be added to the equation... but, i think using statics could actually accomplish all that is needed in a normal sort of game situation...
ANYHOW, I am rambling... if you want an actual example of what I just rambled about, just lemme know. I'll work something up.
*edit* Actually, after thinking a little better [hey, it's 3:40am.. hehe be nice] your friction really wouldnt have an effect on your tipping under an ideal sort of situation, whereas in an unideal, and realistic type world, you would have to account for the sliding of the car [no tipping] and that would use the friction.. but, could also still lead to tipping... but.. blah.. i do hate physics so.
I'm confusing myself now.. bahaha
<P ID="edit"><FONT class="small"><EM>Edited by Spectre on 07/31/01 02:42 AM.</EM></FONT></P>
|
|

07-31-2001, 04:13 PM
|
|
|
Re: Implimenting momentom ??
|
i looked in to physics already but decided that its not a perfect sim that i want to create, for that would involve complicated math and lots of time. And without of taken a physics class im at a loss. however im am still learning and yes i would love an example of.. your "Rambling" it would help me a lot. Thanx
|
|

07-31-2001, 11:08 PM
|
|
|
Re: Implimenting momentom ??
ok, umm.. do me a favour. I shall be busy and might forget to check the forum or somesuch.
If you wish to contact me on ICQ or by Email, do please so i dont forget 
icq: 8371713 [be sure to state your purpose when asking to add me to ur contact list or i'll promptly ignore it  ]
email: Spectre630@hotmail.com same rule applies, make your purpose clear in the subject or it'll get send to the trash with the spam
|
|

08-01-2001, 03:44 AM
|
|
|
Re: Implimenting momentom ??
|
You could use my way in a car system, but moving around tracks would require a change in direction....
so u could use x^2+y^2=pos
this is just some maths thing for drawin a circle in a graph
so u could use that formule make the car maybe follow the circle
i dunno , just an idea
~
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|