Initial commit

Un bout de jeu, qui fait pas grand chose mais on progresse.
This commit is contained in:
Thomas
2025-02-21 17:59:47 +01:00
commit fe463ad396
74 changed files with 59217 additions and 0 deletions

20
joueur.gd Normal file
View File

@@ -0,0 +1,20 @@
class_name Player
extends CharacterBody2D
@export var speed = 450 # How fast the player will move (pixels/sec).
@export var direction = "down";
@export var verb = "idling";
@export var wants_to_grab = false;
@onready var state_machine := $AnimationTree.get("parameters/playback") as AnimationNodeStateMachinePlayback
func get_input():
wants_to_grab = Input.is_action_pressed("grab");
if state_machine.get_current_node() == "grabing":
velocity = Vector2(0,0);
else:
velocity = Input.get_vector("move_left", "move_right", "move_up", "move_down") * speed
func _physics_process(delta):
get_input()
# using move_and_slide
move_and_slide()