small racing game im working on
Diffstat (limited to 'classes/human_car.gd')
| -rw-r--r-- | classes/human_car.gd | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/classes/human_car.gd b/classes/human_car.gd new file mode 100644 index 0000000..989339d --- /dev/null +++ b/classes/human_car.gd @@ -0,0 +1,13 @@ +class_name HumanCar +extends Car + +func _physics_process(delta: float) -> void: + throttle = 0 + throttle -= Input.get_axis("accel", "brake") + throttle *= acceleration + # Get steering input + var steer_val := 0.0 + steer_val += Input.get_axis("ui_left", "ui_right") + steer_val *= max_steering_range + steer(steer_val) + super(delta) |