bushes
This commit is contained in:
4
dino.gd
4
dino.gd
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user