- Joined
- Jun 14, 2007
- Messages
- 56
Yeeah, SUP G
So what I'm trying to do is create a realistic 'sliding' movement style.
A 'car on ice' type situation. And realistic, not like the maze games from war3 where you would have maneouver between objects with complete control over steering, but rather one where you try to steer but you would slide outwards when taking corners, etc
So basically its a question of acceleration!
At the moment:
This gives a rough simulation of what I want, he accelerates towards a point and curves out on some corners, but its far from perfect.
So please, people of the interweb may you help me with this functionn?
What am I doing wrong, good sir? Should I be using vectors for acceleration? Or is the effect achieved in a completerly different way?!
So what I'm trying to do is create a realistic 'sliding' movement style.
A 'car on ice' type situation. And realistic, not like the maze games from war3 where you would have maneouver between objects with complete control over steering, but rather one where you try to steer but you would slide outwards when taking corners, etc
So basically its a question of acceleration!
At the moment:
JASS:
real acceleration = 0.01 (constant)
real x velocity
real y velocity
unit u
real x
real y
point d
if the x of u < the x of point d then
set x velocity = x velocity + acceleration
else
set x velocity = x velocity - acceleration
and then repeat for Y values
and then move unit to his location + x velocity + y velocity
(the above written correctly)
This gives a rough simulation of what I want, he accelerates towards a point and curves out on some corners, but its far from perfect.
So please, people of the interweb may you help me with this functionn?
What am I doing wrong, good sir? Should I be using vectors for acceleration? Or is the effect achieved in a completerly different way?!