summaryrefslogtreecommitdiffhomepage
path: root/Racing-Game/4WheelCar/Wheels/BackWheel.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Racing-Game/4WheelCar/Wheels/BackWheel.gd')
-rw-r--r--Racing-Game/4WheelCar/Wheels/BackWheel.gd11
1 files changed, 6 insertions, 5 deletions
diff --git a/Racing-Game/4WheelCar/Wheels/BackWheel.gd b/Racing-Game/4WheelCar/Wheels/BackWheel.gd
index 88df113..f9b67aa 100644
--- a/Racing-Game/4WheelCar/Wheels/BackWheel.gd
+++ b/Racing-Game/4WheelCar/Wheels/BackWheel.gd
@@ -18,19 +18,20 @@ func _process(delta):
velocity = measure_velocity()
#---
set_rotation(carAngle)
+ wheelAngle = get_transform().get_rotation()
isSkid = Input.is_action_pressed("grip")
-
+
if Input.is_action_pressed("grip") || Input.is_action_pressed("brake"):
nullStrength += max(5,velocity/7)
else:
- nullStrength += 1
-
+ nullStrength += 5
+
#Braking
setBrake(0)
null_slide(nullStrength, delta)
-
-
+
+
if Input.is_action_pressed("forward"):
if !Input.is_action_pressed("brake"):
apply_central_impulse(Vector2(0,-gear(velocity, hp, acceleration)).rotated(carAngle)*delta*5000)