Simulating a Bicycle
![monkeysalad](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
I'm building a bike-racing sidescroller, and I'm curious how other people would go about simulating the way a bike controls.
The way I'm doing it is using a PC_Bike actor with friction of 1 (so he rolls on slopes), and to simulate pedaling I use the self.Accellerate attribute, which I interpolate from 700 to 0 every time the pedal key is pressed (so it cant be spammed). I also turn off accelleration if the bike is in the air.
So I'm pretty happy with the way this works, I have a controllable player that also responds to physics, so I can do jumps etc.
The main problem I'm having is that on steep hills, the player slides backwards because acceleration isnt enough. But If I increase that value any more, the player moves too fast and it stops feeling like a bicycle. One idea I have is to increase self.friction while pedaling.
Does anyone have any other ideas or suggestions of how to build a control scheme that feels like pedaling a bike?
I think this is also generally applicable to any sidescroller where you want the character to respond to physics. I like the feel of self.Accellerate better than using the Move behavior (like the Gamesalad platformer template uses), but its certainly possible theres a better approach to sidescroller controls.
The way I'm doing it is using a PC_Bike actor with friction of 1 (so he rolls on slopes), and to simulate pedaling I use the self.Accellerate attribute, which I interpolate from 700 to 0 every time the pedal key is pressed (so it cant be spammed). I also turn off accelleration if the bike is in the air.
So I'm pretty happy with the way this works, I have a controllable player that also responds to physics, so I can do jumps etc.
The main problem I'm having is that on steep hills, the player slides backwards because acceleration isnt enough. But If I increase that value any more, the player moves too fast and it stops feeling like a bicycle. One idea I have is to increase self.friction while pedaling.
Does anyone have any other ideas or suggestions of how to build a control scheme that feels like pedaling a bike?
I think this is also generally applicable to any sidescroller where you want the character to respond to physics. I like the feel of self.Accellerate better than using the Move behavior (like the Gamesalad platformer template uses), but its certainly possible theres a better approach to sidescroller controls.
Answers