Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a40afb5463 |
@@ -4,11 +4,12 @@ extends CharacterBody2D
|
||||
@export var friction := 0.98
|
||||
@export var max_speed := 1000.0
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
var direction = Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
||||
#
|
||||
velocity += direction * thrust * delta
|
||||
velocity *= friction
|
||||
|
||||
|
||||
velocity = velocity.limit_length(max_speed)
|
||||
move_and_slide()
|
||||
Reference in new issue
Block a user