This commit is contained in:
2026-05-17 17:18:54 +02:00
parent c9137365b5
commit 086cc1d229
6 changed files with 91 additions and 24 deletions

View File

@@ -1,10 +1,9 @@
extends CharacterBody2D
@onready var jump: AudioStreamPlayer = $Jump
const SPEED = 300.0
const JUMP_VELOCITY = -800.0
func _physics_process(delta: float) -> void:
# Add the gravity.
if not is_on_floor():
@@ -13,6 +12,7 @@ func _physics_process(delta: float) -> void:
# Handle jump.
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
velocity.y = JUMP_VELOCITY
jump.play()
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.