The Daily Click ::. Forums ::. Klik Coding Help ::. Deacceleration?
 

Post Reply  Post Oekaki 
 

Posted By Message

KevinHaag



Registered
  28/01/2005
Points
  266

VIP Member
18th April, 2005 at 23:27:21 -

In my mini golf game, i have it so when you choose how much power your gonna use to putt the ball, it sets the speed of the balls bounce ball movement to the amount of power you use. But the problem is, when I do that, the deacceleration of the bounce ball movement doesn't work. Can anybody tell me how to fix this or how to do a custom bounce ball movement so it can deaccelerat?

 
Image
http://www.kevinhaag.ca

Dogzer



Registered
  07/02/2011
Points
  1029
18th April, 2005 at 23:38:50 -

You should substract from the speed the friction coefficient of the ground multiplied by the currnet speed of the ball. The ball will explode you know..

 
n/a

KevinHaag



Registered
  28/01/2005
Points
  266

VIP Member
19th April, 2005 at 00:00:15 -

I dont understand a word that you just said.

 
Image
http://www.kevinhaag.ca

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
19th April, 2005 at 04:43:47 -

Are you perhaps continually setting the speed to the speed chosen when you hit the ball? Try "Only one action when event loops".

 
http://www.davidn.co.nr - Games, music, living in America

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
19th April, 2005 at 08:03:00 -

if the speed goes below 0 it will speed up to 100 again, subtract from it only if the speed is greater than 0. And also make sure it isn't continually setting the speed to to the power counter, use "one action when event loops" or set the power counter to 0 after you hit the ball.

 
n/a

KevinHaag



Registered
  28/01/2005
Points
  266

VIP Member
19th April, 2005 at 09:50:34 -

How do i make it so the event "only loops once"?

 
Image
http://www.kevinhaag.ca

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
19th April, 2005 at 09:52:37 -

When you add an event, click "Special" (it looks like a tool in TGF, and 2 computers in MMF), then click Limit Conditions, then click Only one action when event loops.

 
a/n

KevinHaag



Registered
  28/01/2005
Points
  266

VIP Member
19th April, 2005 at 09:53:40 -

OK. By the way... im using TGF.

 
Image
http://www.kevinhaag.ca

KevinHaag



Registered
  28/01/2005
Points
  266

VIP Member
19th April, 2005 at 09:56:55 -

It didn't work. Instead of only setting a continous speed of the ball, can I subract from the speed of the ball?(TGF) I thought if i made it so every .10 of a second it will subrtract 1 from the speed of the ball.

But i have to know how to subtract from the speed.

 
Image
http://www.kevinhaag.ca

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
19th April, 2005 at 11:04:54 -

every 00:10
- set speed of (ball) to: speed of (ball) - 1

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
19th April, 2005 at 12:04:18 -

Dogzer you fool, friction is dependent on the normal contact force, not the speed. Doing what you did would've caused the ball to explode for real, you mischevious trickster!

 
n/a

KevinHaag



Registered
  28/01/2005
Points
  266

VIP Member
19th April, 2005 at 14:12:40 -

Thanks Phizzy, ill try that when I get home as i am at school at the moment. I hate school.:@

 
Image
http://www.kevinhaag.ca

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
19th April, 2005 at 14:28:49 -

you really should get some sense of humour

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
20th April, 2005 at 05:56:38 -

LOL. Believe it or not, dogzer was right.

Assuming Alterable Value A = Friction coefficient...

Every ____ seconds, speed -> speed - (AV A)*speed
If speed < 0, set speed -> 0

Set AV A to whatever number you want, but below 1 (around 0.2 or so, depending on how fast you want it to be). Or set it as a global value, counter, etc.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image
   

Post Reply



 



Advertisement

Worth A Click