🐛 Fixes missing gravity on death state

main
Ervan Lefevre 2 years ago
parent 54bf676493
commit a673356992
  1. 5
      nodes/player/player.gd
  2. 2
      nodes/player/player.tscn

@ -16,7 +16,7 @@ const STATES= [
var use_gravity = {
"climb": false,
"die": false,
"die": true,
"idle": true,
"jump": true,
"spawn": true,
@ -30,7 +30,7 @@ func _ready():
$fsm.set_states(STATES)
add_to_group("player")
func _enter_spawn():
func on_enter_spawn_state():
$fsm.set_next_state("idle")
func on_enter_idle_state():
@ -59,7 +59,6 @@ func walk_state(_delta):
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
$fsm.set_next_state("jump")
# detect collision with wall or ceiling to enter climb state
if is_on_wall() or (Input.is_action_pressed('ui_up') && is_on_ceiling()):
velocity.y = 0
$fsm.set_next_state("climb")

@ -24,4 +24,4 @@ shape = SubResource("CapsuleShape2D_w17ly")
metadata/_edit_group_ = true
[node name="camera" type="Camera2D" parent="."]
zoom = Vector2(4, 4)
zoom = Vector2(5, 5)

Loading…
Cancel
Save