Merge branch 'main' of git.snrd.eu:giantroostergames/LD54
This commit is contained in:
commit
40cec00116
1 changed files with 6 additions and 1 deletions
|
@ -70,10 +70,15 @@ func _process(delta):
|
|||
if !Input.is_action_pressed("brake"):
|
||||
momentum = Vector2(1,0).rotated(rotation) * momentum.length()
|
||||
|
||||
camera.position = Vector2((momentum.length() / max_speed) * camera_offset, 0)
|
||||
camera.position = Vector2(get_speed_proportion() * camera_offset, 0)
|
||||
camera.rotation_degrees = momentum.angle() + 90
|
||||
|
||||
$engine_sounds.pitch_scale = get_speed_proportion() + .2
|
||||
|
||||
if momentum.length() > max_speed:
|
||||
momentum = momentum.normalized() * max_speed
|
||||
speed_changed.emit(momentum.length())
|
||||
move_and_collide(momentum * delta)
|
||||
|
||||
func get_speed_proportion():
|
||||
return (momentum.length() / max_speed)
|
||||
|
|
Loading…
Reference in a new issue