Added player and a basic test level

This commit is contained in:
2026-02-06 16:00:03 -05:00
parent 1b0f1c9080
commit 83a4a8f374
104 changed files with 6897 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
extends NodeState
@export var player: Player
@export var animatedSprite2D: AnimatedSprite2D
@export var collisionShapeMove: AnimationPlayer
@onready var friction = player.friction
@warning_ignore("unused_parameter")
func on_process(delta: float) -> void:
pass
@warning_ignore("unused_parameter")
func on_phyisics_process(delta: float) -> void:
player.velocity.x = move_toward(player.velocity.x, 0, friction * delta)
transition_states()
func enter() -> void:
collisionShapeMove.play("Crouch")
animatedSprite2D.play("Crouch")
func exit() -> void:
animatedSprite2D.stop()
func transition_states() -> void:
#transition states
#run state
var direction = GameInputEvents.movement_input()
if !player.is_on_floor():
collisionShapeMove.play("Normal")
transition.emit("fall")
if direction and player.is_on_floor():
transition.emit("crouchwalk")
#jump state
if GameInputEvents.jump_input():
collisionShapeMove.play("Normal")
transition.emit("jump")
#idle state
if not Input.is_action_pressed("crouch"):
collisionShapeMove.play("Normal")
transition.emit("idle")