fixed that speed was relative to framerate
This commit is contained in:
commit
753cb4eb2a
2 changed files with 6 additions and 5 deletions
|
@ -8,10 +8,11 @@ size = Vector2(36, 20)
|
|||
|
||||
[node name="player" type="StaticBody2D" node_paths=PackedStringArray("camera")]
|
||||
script = ExtResource("1_g4ij8")
|
||||
dec = 15.0
|
||||
max_speed = 50.0
|
||||
acc = 500.0
|
||||
dec = 400.0
|
||||
max_speed = 1000.0
|
||||
turn_speed = 2.0
|
||||
brake_strength = 12.0
|
||||
brake_strength = 60.0
|
||||
camera = NodePath("Camera2D")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
|
|
|
@ -13,7 +13,7 @@ extends StaticBody2D
|
|||
## regulates how much more you can turn while breaking, values below 1 mean you can turn worse while drifting
|
||||
@export var drift_factor := 1.5
|
||||
## regulates how far the camera looks ahead of the player (affected by speed)
|
||||
@export var camera_offset_factor = 20.
|
||||
@export var camera_offset_factor = .2
|
||||
|
||||
# references
|
||||
@export var camera : Camera2D
|
||||
|
@ -59,4 +59,4 @@ func _process(delta):
|
|||
|
||||
if momentum.length() > max_speed:
|
||||
momentum = momentum.normalized() * max_speed
|
||||
move_and_collide(momentum)
|
||||
move_and_collide(momentum * delta)
|
||||
|
|
Loading…
Reference in a new issue