How do I accelerate a car to full speed

Get help using Construct 2

Post » Fri Mar 20, 2015 12:11 am

The player in my game is a vehicle that drives similar to a car which is why I used the car behavior. I made several buttons to select different speeds. I press the button and the vehicle goes to the speed I put in the event instantly instead of accelerating to the speed. The event action ignores the acceleration speed in the properties window of the vehicle. If I use the arrow keys the vehicle accelerates properly.

How do I tell the player vehicle to accelerate to the set speed over time with the press of a button? I tried searching for this in the forums and found things similar to my problem but not the same. I'm new here so please forgive me I'm not trying to be lazy, lol.
B
5
Posts: 2
Reputation: 229

Post » Fri Mar 20, 2015 12:16 am

Set an instance variable TargetSpeed. Then if Speed < TargetSpeed, Speed = speed + Acceleration*dt
B
14
S
5
G
1
Posts: 189
Reputation: 1,536


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 10 guests