Compare commits

...

2 Commits

Author SHA1 Message Date
Ervan Lefevre 54bf676493 🚚 Main menu now routes to poc.tscn 2 years ago
Ervan Lefevre 27523b5a9b 🐛 Remove sliding effect while falling from ceiling 2 years ago
  1. 7
      nodes/player/player.gd
  2. 2
      scenes/main_menu.tscn
  3. 2
      scripts/ui/change_scene_button.gd

@ -39,6 +39,9 @@ func on_enter_idle_state():
func idle_state(_delta):
var direction = Input.get_axis("ui_left", "ui_right")
if is_on_floor():
velocity.x = 0
if direction:
$fsm.set_next_state("walk")
elif Input.is_action_just_pressed("ui_accept") and is_on_floor():
@ -57,7 +60,7 @@ func walk_state(_delta):
$fsm.set_next_state("jump")
# detect collision with wall or ceiling to enter climb state
if is_on_wall() or is_on_ceiling():
if is_on_wall() or (Input.is_action_pressed('ui_up') && is_on_ceiling()):
velocity.y = 0
$fsm.set_next_state("climb")
@ -78,7 +81,7 @@ func jump_state(_delta):
velocity.x = 0
$fsm.set_next_state("idle")
if is_on_wall() or is_on_ceiling():
if is_on_wall() || (is_on_ceiling() and Input.is_action_pressed("ui_up")):
$fsm.set_next_state("climb")
func on_enter_climb_state():

@ -35,7 +35,7 @@ offset_right = 1279.0
offset_bottom = 853.0
text = "Play"
script = ExtResource("1_2rx5y")
TARGET_SCENE = "res://scenes/main_menu.tscn"
TARGET_SCENE = "res://scenes/poc.tscn"
[node name="quit" type="Button" parent="."]
layout_mode = 0

@ -5,4 +5,4 @@ class_name SceneChanger
func _pressed():
print("Changing scene to: " + TARGET_SCENE)
get_tree().change_scene(TARGET_SCENE)
get_tree().change_scene_to_file(TARGET_SCENE)

Loading…
Cancel
Save