Friction

Talk about making games.

Friction

Postby ondy1985 » Sun Jul 03, 2005 1:30 pm

Hello everyone.

Is there a way I can simulate friction in GE? Let's say I want to make a soccer viewed from above and I want the ball to lose speed after it's been kicked so it would stop smoothly. Any ideas?

EDIT:
One more thing: you don't know the angle the ball has so the directional_velocity can't be used.
Last edited by ondy1985 on Sun Jul 03, 2005 6:32 pm, edited 1 time in total.
User avatar
ondy1985
 
Posts: 99
Joined: Thu May 05, 2005 7:43 pm
Location: Slovakia
Score: 1 Give a positive score

Postby Game A Gogo » Sun Jul 03, 2005 3:21 pm

Code: Select all
directional_velocity *= 1;

if ( directional_velocity < 0.1)
  directional_velocity *= 0.75;


In DrawActor envent, it should work
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby ondy1985 » Sun Jul 03, 2005 6:30 pm

No, I can't use 'directional_velocity' variable because it's equal to zero so there's nothing to decrement. The 'angle' variable is zero as well.

Ball movement is forced by Physical Response action after a collison. But I think xvelocity and yvelocity should be nonzero so I'll just decrement each of them by a constant each time the actor is drawn. Gonna try.
User avatar
ondy1985
 
Posts: 99
Joined: Thu May 05, 2005 7:43 pm
Location: Slovakia
Score: 1 Give a positive score

Postby makslane » Mon Jul 04, 2005 2:39 pm

You can use the directional_velocity without problems.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest