The Daily Click ::. Forums ::. Klik Coding Help ::. How to climb down slopes?
 

Post Reply  Post Oekaki 
 

Posted By Message

Spitznagl

Cabinetmaker

Registered
  06/12/2008
Points
  4260

The SpinsterVIP MemberHas Donated, Thank You!Picture Me This Round 29 Winner!Picture Me This Round 31 Winner!Picture Me This Round 36 Winner!
14th June, 2009 at 20:36:31 -

I'm working on a side-view scooter engine, where both wheels (separate objects) are checked for collision & every scooter parts are rotated and repostioned using Sin and Cos. I've succeded in making everything climb up smoothly, no matter the slope angle.

Now I want to work on the climb down events, but I don't really know where to start. Even not considering the rotation & multiple objects part, what would be the best way to go down slopes. I figure that after the "Horizontal loop", I need to get the wheels back on the ground before the "Gravity loop" starts, but I'd like to know how you would do it, or check a good tutorial if you know any.

 
...

W3R3W00F

Drum and Bass Fueled Psycho

Registered
  08/11/2008
Points
  368

VIP MemberCardboard BoxThe Cake is a Lie
14th June, 2009 at 21:22:52 -

I'd love to help, but what you've accomplished is exactly what I'm trying to get. I hope you find what you're looking for though!



 
n/a

Spitznagl

Cabinetmaker

Registered
  06/12/2008
Points
  4260

The SpinsterVIP MemberHas Donated, Thank You!Picture Me This Round 29 Winner!Picture Me This Round 31 Winner!Picture Me This Round 36 Winner!
14th June, 2009 at 21:42:56 -


Originally Posted by W3R3W00F
I'd love to help, but what you've accomplished is exactly what I'm trying to get. I hope you find what you're looking for though!


Then, if you're blocked at some point, just ask me.
Also, it must be for Project: Nitro I guess?

 
...

W3R3W00F

Drum and Bass Fueled Psycho

Registered
  08/11/2008
Points
  368

VIP MemberCardboard BoxThe Cake is a Lie
14th June, 2009 at 22:13:12 -

Yeah, it'd be for Project: Nitro. I'll figure it out one of these days, maybe. Sorry if I got off topic.

 
n/a

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
14th June, 2009 at 22:31:02 -

If you can do it up, you should be able to reverse your code to support going down as well?
Perhaps you need to write it out and figure out exactly why it goes up so well, and then play around with it until it can do down as well. Though I suppose going up a slope you are taking out the gravity factor because you're always touching the ground, whereas you want to be pulled down for down slopes..

 
n/a

Spitznagl

Cabinetmaker

Registered
  06/12/2008
Points
  4260

The SpinsterVIP MemberHas Donated, Thank You!Picture Me This Round 29 Winner!Picture Me This Round 31 Winner!Picture Me This Round 36 Winner!
14th June, 2009 at 23:33:17 -

Ok, I figured it out

@ jthongbai:
What you said helped me to think. You where wrong on one thing though. We indeed don't take gravity into consideration while going up, but we also don't want the gravity to take effect while going down, because, that's what make your object "kick" on the surface.

So as the last event in the Horizontal loop (wich happens before the gravity loop), When the back wheel's collider doesn't overlap the ground and the gravity = 0 -> Bring everything down by one pixel.

Then only, the event that triggers the gravity loop is checked and returns false, since the back wheel already went back on the ground in time.

 
...

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
15th June, 2009 at 08:58:10 -

Glad I helped in some kind of way, good work

 
n/a
   

Post Reply



 



Advertisement

Worth A Click