faire le ménage dans le bouzin

abracadabrac!
This commit is contained in:
Thomas
2025-02-21 18:30:27 +01:00
parent fe463ad396
commit bf4bfb9f5a
19 changed files with 527 additions and 4462 deletions

View File

@@ -1,44 +0,0 @@
[gd_scene load_steps=4 format=3 uid="uid://baywvs4i4flug"]
[sub_resource type="Animation" id="Animation_ox0ew"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
[sub_resource type="Animation" id="Animation_jdm18"]
resource_name = "idle_right"
length = 0.7
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [56, 57, 58, 59, 60, 60, 61]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_l2iau"]
_data = {
"RESET": SubResource("Animation_ox0ew"),
"idle_right": SubResource("Animation_jdm18")
}
[node name="AnimationPlayer" type="AnimationPlayer"]
libraries = {
"": SubResource("AnimationLibrary_l2iau")
}

View File

@@ -1,9 +0,0 @@
[gd_scene load_steps=2 format=3 uid="uid://cjp5bk3jyul4f"]
[ext_resource type="Texture2D" uid="uid://bsmk7gmdxhn5p" path="res://assest/persos/hero.png" id="1_8t3lc"]
[node name="Sprite2D" type="Sprite2D"]
texture = ExtResource("1_8t3lc")
hframes = 56
vframes = 20
frame = 59

View File

@@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://cg4dhp7qe68pt"]
[ext_resource type="Texture2D" uid="uid://bsmk7gmdxhn5p" path="res://assest/persos/hero.png" id="1_msb5a"]
[node name="Sprite2D" type="Sprite2D"]
texture = ExtResource("1_msb5a")
hframes = 56
vframes = 20
frame = 78

View File

@@ -0,0 +1,321 @@
[gd_scene load_steps=21 format=3 uid="uid://bvsendl25xjju"]
[sub_resource type="Animation" id="Animation_ox0ew"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
[sub_resource type="Animation" id="Animation_rma32"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [590, 591, 592, 593, 594, 595, 596, 597, 598, 599]
}
[sub_resource type="Animation" id="Animation_kyg5d"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [580, 581, 582, 583, 584, 585, 586, 587, 588, 589]
}
[sub_resource type="Animation" id="Animation_vq2rn"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [560, 561, 562, 563, 564, 565, 566, 567, 568, 569]
}
[sub_resource type="Animation" id="Animation_kcojr"]
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [570, 571, 572, 573, 574, 575, 576, 577, 578, 579]
}
[sub_resource type="Animation" id="Animation_x55al"]
length = 1.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551]
}
[sub_resource type="Animation" id="Animation_b67jn"]
length = 1.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [528, 529, 530, 531, 532, 533, 534, 535, 536, 536, 537, 538]
}
[sub_resource type="Animation" id="Animation_pfabv"]
length = 1.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515]
}
[sub_resource type="Animation" id="Animation_gjwq5"]
length = 1.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527]
}
[sub_resource type="Animation" id="Animation_b4kqc"]
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [74, 75, 76, 77, 78, 79]
}
[sub_resource type="Animation" id="Animation_mwj7w"]
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [68, 69, 70, 71, 72, 73]
}
[sub_resource type="Animation" id="Animation_jdm18"]
resource_name = "idle_right"
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [56, 57, 58, 59, 60, 61]
}
[sub_resource type="Animation" id="Animation_55bsc"]
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [62, 63, 64, 65, 66, 67]
}
[sub_resource type="Animation" id="Animation_u4gjw"]
length = 1.2
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403]
}
[sub_resource type="Animation" id="Animation_tp2bg"]
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [168, 169, 170, 171, 172, 173]
}
[sub_resource type="Animation" id="Animation_usdt0"]
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [130, 131, 132, 133, 134, 135]
}
[sub_resource type="Animation" id="Animation_xyu25"]
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [124, 125, 126, 127, 128, 129]
}
[sub_resource type="Animation" id="Animation_37o3j"]
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [112, 113, 114, 115, 116, 117]
}
[sub_resource type="Animation" id="Animation_lde32"]
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [118, 119, 120, 121, 122, 123]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_l2iau"]
_data = {
"RESET": SubResource("Animation_ox0ew"),
"giving_down": SubResource("Animation_rma32"),
"giving_left": SubResource("Animation_kyg5d"),
"giving_right": SubResource("Animation_vq2rn"),
"giving_up": SubResource("Animation_kcojr"),
"grabbing_down": SubResource("Animation_x55al"),
"grabbing_left": SubResource("Animation_b67jn"),
"grabbing_right": SubResource("Animation_pfabv"),
"grabbing_up": SubResource("Animation_gjwq5"),
"idle_down": SubResource("Animation_b4kqc"),
"idle_left": SubResource("Animation_mwj7w"),
"idle_right": SubResource("Animation_jdm18"),
"idle_up": SubResource("Animation_55bsc"),
"reading": SubResource("Animation_u4gjw"),
"sleeping": SubResource("Animation_tp2bg"),
"walking_down": SubResource("Animation_usdt0"),
"walking_left": SubResource("Animation_xyu25"),
"walking_right": SubResource("Animation_37o3j"),
"walking_up": SubResource("Animation_lde32")
}
[node name="AnimationPlayer" type="AnimationPlayer"]
libraries = {
"": SubResource("AnimationLibrary_l2iau")
}

View File

@@ -0,0 +1,88 @@
[gd_resource type="AnimationNodeStateMachine" load_steps=19 format=3 uid="uid://ddr1ltkievtku"]
[ext_resource type="AnimationNodeBlendSpace2D" uid="uid://cy73mgvdr54rh" path="res://animations/human/human_walking_blend.tres" id="1_svxl8"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_8th2p"]
animation = &"grabbing_left"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_s1koi"]
animation = &"grabbing_right"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_11i5t"]
animation = &"grabbing_up"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_7cwjq"]
animation = &"grabbing_down"
[sub_resource type="AnimationNodeBlendSpace2D" id="AnimationNodeBlendSpace2D_8okss"]
blend_point_0/node = SubResource("AnimationNodeAnimation_8th2p")
blend_point_0/pos = Vector2(-1, 0)
blend_point_1/node = SubResource("AnimationNodeAnimation_s1koi")
blend_point_1/pos = Vector2(1, 0)
blend_point_2/node = SubResource("AnimationNodeAnimation_11i5t")
blend_point_2/pos = Vector2(0, -1)
blend_point_3/node = SubResource("AnimationNodeAnimation_7cwjq")
blend_point_3/pos = Vector2(0, 1)
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_u7tkr"]
animation = &"idle_left"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_qbdxx"]
animation = &"idle_right"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_m4jlv"]
animation = &"idle_up"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_20jnf"]
animation = &"idle_down"
[sub_resource type="AnimationNodeBlendSpace2D" id="AnimationNodeBlendSpace2D_epue7"]
blend_point_0/node = SubResource("AnimationNodeAnimation_u7tkr")
blend_point_0/pos = Vector2(-1, 0)
blend_point_1/node = SubResource("AnimationNodeAnimation_qbdxx")
blend_point_1/pos = Vector2(1, 0)
blend_point_2/node = SubResource("AnimationNodeAnimation_m4jlv")
blend_point_2/pos = Vector2(0, -1)
blend_point_3/node = SubResource("AnimationNodeAnimation_20jnf")
blend_point_3/pos = Vector2(0, 1)
blend_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_qfvli"]
advance_mode = 2
advance_expression = "velocity"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8rhh4"]
advance_mode = 2
advance_expression = "!velocity"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_b5dux"]
advance_mode = 2
advance_expression = "velocity"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8q1xr"]
advance_mode = 2
advance_expression = "!velocity"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_on1es"]
advance_mode = 2
advance_expression = "wants_to_grab"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_pxk2l"]
advance_mode = 2
advance_expression = "wants_to_grab"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_t6jft"]
break_loop_at_end = true
switch_mode = 2
advance_mode = 2
[resource]
states/Start/position = Vector2(161.333, 82)
states/grabing/node = SubResource("AnimationNodeBlendSpace2D_8okss")
states/grabing/position = Vector2(629, 81.037)
states/idling/node = SubResource("AnimationNodeBlendSpace2D_epue7")
states/idling/position = Vector2(383.148, 81.5555)
states/walking/node = ExtResource("1_svxl8")
states/walking/position = Vector2(382.556, -106.667)
transitions = ["Start", "walking", SubResource("AnimationNodeStateMachineTransition_qfvli"), "walking", "idling", SubResource("AnimationNodeStateMachineTransition_8rhh4"), "idling", "walking", SubResource("AnimationNodeStateMachineTransition_b5dux"), "Start", "idling", SubResource("AnimationNodeStateMachineTransition_8q1xr"), "idling", "grabing", SubResource("AnimationNodeStateMachineTransition_on1es"), "walking", "grabing", SubResource("AnimationNodeStateMachineTransition_pxk2l"), "grabing", "idling", SubResource("AnimationNodeStateMachineTransition_t6jft")]
graph_offset = Vector2(-18, -138)

View File

@@ -0,0 +1,39 @@
[gd_scene load_steps=6 format=3 uid="uid://vclpg4e4ql54"]
[ext_resource type="Script" path="res://caracters/player/player_controler.gd" id="1_oapm5"]
[ext_resource type="AnimationNodeStateMachine" uid="uid://ddr1ltkievtku" path="res://animations/human/human_state_machine.tres" id="3_1y7fn"]
[ext_resource type="PackedScene" uid="uid://bvsendl25xjju" path="res://animations/human/human_animation_player.tscn" id="3_c286j"]
[ext_resource type="PackedScene" uid="uid://cg4dhp7qe68pt" path="res://animations/human/human.tscn" id="4_rsj36"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_a4vmx"]
radius = 5.0
height = 48.0
[node name="CharacterBody2D" type="CharacterBody2D"]
z_index = 100
motion_mode = 1
script = ExtResource("1_oapm5")
[node name="Camera2D" type="Camera2D" parent="."]
zoom = Vector2(0.7, 0.7)
position_smoothing_enabled = true
drag_horizontal_enabled = true
drag_vertical_enabled = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 43)
rotation = 1.5708
shape = SubResource("CapsuleShape2D_a4vmx")
[node name="AnimationTree" type="AnimationTree" parent="."]
tree_root = ExtResource("3_1y7fn")
advance_expression_base_node = NodePath("..")
anim_player = NodePath("../AnimationPlayer")
parameters/grabing/blend_position = Vector2(0, 0)
parameters/idling/blend_position = Vector2(-0.353287, 0.839053)
parameters/walking/blend_position = Vector2(0, 0)
[node name="AnimationPlayer" parent="." instance=ExtResource("3_c286j")]
[node name="Sprite2D" parent="." instance=ExtResource("4_rsj36")]
frame = 1

View File

@@ -0,0 +1,36 @@
class_name PlayerControler
extends CharacterBody2D
@export var speed = 450 # How fast the player will move (pixels/sec).
# intensions of the player turner into a boolean
@export var wants_to_grab = false;
@onready var animation_tree := $AnimationTree
@onready var state_machine := animation_tree.get("parameters/playback") as AnimationNodeStateMachinePlayback
var last_facing_direction = Vector2(0,-1) # facing south
func readInputs():
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 updateFacingDirectionInAnimationTree():
animation_tree.set("parameters/walking/blend_position", last_facing_direction)
animation_tree.set("parameters/idling/blend_position", last_facing_direction)
animation_tree.set("parameters/grabing/blend_position", last_facing_direction)
func _physics_process(delta):
readInputs()
# move the caracter
move_and_slide()
# compute the direction the player wants to look at
if velocity:
last_facing_direction = velocity.normalized()
updateFacingDirectionInAnimationTree()

View File

@@ -1,20 +0,0 @@
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()

View File

@@ -1,8 +1,8 @@
[gd_scene load_steps=4 format=4 uid="uid://d1oqt6sbjvopi"] [gd_scene load_steps=4 format=4 uid="uid://d1oqt6sbjvopi"]
[ext_resource type="TileSet" uid="uid://ckj00wy20rkfx" path="res://assest/tilesets/exterieur.tres" id="1_s310m"] [ext_resource type="TileSet" uid="uid://ckj00wy20rkfx" path="res://assest/tilesets/exterieur.tres" id="1_s310m"]
[ext_resource type="PackedScene" uid="uid://yn8fq44nqwd2" path="res://batiments/immeuble_1.tscn" id="2_cfh67"] [ext_resource type="PackedScene" uid="uid://yn8fq44nqwd2" path="res://buildings/generic1.tscn" id="2_cfh67"]
[ext_resource type="PackedScene" uid="uid://6i4u378og5o5" path="res://batiments/boulangerie.tscn" id="3_tn4jn"] [ext_resource type="PackedScene" uid="uid://6i4u378og5o5" path="res://buildings/bakery.tscn" id="3_tn4jn"]
[node name="Node2D" type="Node2D"] [node name="Node2D" type="Node2D"]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +0,0 @@
extends Node2D
@export var animation_tree: AnimationTree
@onready var player : Player = get_owner()
var last_facing_direction = Vector2(0,-1) # facing south
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var idle = !player.velocity
if !idle:
last_facing_direction = player.velocity.normalized()
animation_tree.set("parameters/walking/blend_position", last_facing_direction)
animation_tree.set("parameters/idling/blend_position", last_facing_direction)
animation_tree.set("parameters/grabing/blend_position", last_facing_direction)

View File

@@ -1,8 +1,8 @@
[gd_scene load_steps=6 format=3 uid="uid://b4ydi1vv8dvwr"] [gd_scene load_steps=6 format=3 uid="uid://b4ydi1vv8dvwr"]
[ext_resource type="PackedScene" uid="uid://d1oqt6sbjvopi" path="res://cartes/monde.tscn" id="1_6vs81"] [ext_resource type="PackedScene" uid="uid://d1oqt6sbjvopi" path="res://maps/world.tscn" id="1_6vs81"]
[ext_resource type="PackedScene" uid="uid://vclpg4e4ql54" path="res://personages/joueur.tscn" id="2_5x6b5"] [ext_resource type="PackedScene" uid="uid://vclpg4e4ql54" path="res://caracters/player/player.tscn" id="2_5x6b5"]
[ext_resource type="PackedScene" uid="uid://cl201baro5y5" path="res://vehicules/voiture_pnj.tscn" id="3_yuakw"] [ext_resource type="PackedScene" uid="uid://cl201baro5y5" path="res://vehicules/npc_car.tscn" id="3_yuakw"]
[sub_resource type="Curve2D" id="Curve2D_shblg"] [sub_resource type="Curve2D" id="Curve2D_shblg"]
_data = { _data = {

View File

@@ -1,103 +1,103 @@
[gd_scene load_steps=33 format=3 uid="uid://bt1p311rn1h6q"] [gd_scene load_steps=33 format=3 uid="uid://bt1p311rn1h6q"]
[ext_resource type="Script" path="res://vehicules/voiture.gd" id="1_3v1b0"] [ext_resource type="Script" path="res://vehicules/car.gd" id="1_vkq5y"]
[ext_resource type="Texture2D" uid="uid://55dsls4caujg" path="res://assest/vehicules/Car_classic_red_complete_48x48.png" id="1_hqmt6"] [ext_resource type="Texture2D" uid="uid://55dsls4caujg" path="res://assest/vehicules/Car_classic_red_complete_48x48.png" id="2_ahai6"]
[ext_resource type="Texture2D" uid="uid://c5dis1wikcqws" path="res://assest/vehicules/Car_classic_red_complete_48x48_left.png" id="2_6v2yy"] [ext_resource type="Texture2D" uid="uid://c5dis1wikcqws" path="res://assest/vehicules/Car_classic_red_complete_48x48_left.png" id="3_tnfoa"]
[sub_resource type="AtlasTexture" id="AtlasTexture_8fi8c"] [sub_resource type="AtlasTexture" id="AtlasTexture_8fi8c"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(3408, 222, 96, 210) region = Rect2(3408, 222, 96, 210)
[sub_resource type="AtlasTexture" id="AtlasTexture_tgw3a"] [sub_resource type="AtlasTexture" id="AtlasTexture_tgw3a"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(3504, 222, 96, 210) region = Rect2(3504, 222, 96, 210)
[sub_resource type="AtlasTexture" id="AtlasTexture_dj0xl"] [sub_resource type="AtlasTexture" id="AtlasTexture_dj0xl"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(3600, 222, 96, 210) region = Rect2(3600, 222, 96, 210)
[sub_resource type="AtlasTexture" id="AtlasTexture_omrb2"] [sub_resource type="AtlasTexture" id="AtlasTexture_omrb2"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(3696, 222, 96, 210) region = Rect2(3696, 222, 96, 210)
[sub_resource type="AtlasTexture" id="AtlasTexture_l4q1w"] [sub_resource type="AtlasTexture" id="AtlasTexture_l4q1w"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(3792, 222, 96, 210) region = Rect2(3792, 222, 96, 210)
[sub_resource type="AtlasTexture" id="AtlasTexture_qjaw0"] [sub_resource type="AtlasTexture" id="AtlasTexture_qjaw0"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(3888, 222, 96, 210) region = Rect2(3888, 222, 96, 210)
[sub_resource type="AtlasTexture" id="AtlasTexture_cjmr1"] [sub_resource type="AtlasTexture" id="AtlasTexture_cjmr1"]
atlas = ExtResource("2_6v2yy") atlas = ExtResource("3_tnfoa")
region = Rect2(0, 0, 240, 144) region = Rect2(0, 0, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_0i1ge"] [sub_resource type="AtlasTexture" id="AtlasTexture_0i1ge"]
atlas = ExtResource("2_6v2yy") atlas = ExtResource("3_tnfoa")
region = Rect2(240, 0, 240, 144) region = Rect2(240, 0, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_lss5r"] [sub_resource type="AtlasTexture" id="AtlasTexture_lss5r"]
atlas = ExtResource("2_6v2yy") atlas = ExtResource("3_tnfoa")
region = Rect2(480, 0, 240, 144) region = Rect2(480, 0, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_8ccj1"] [sub_resource type="AtlasTexture" id="AtlasTexture_8ccj1"]
atlas = ExtResource("2_6v2yy") atlas = ExtResource("3_tnfoa")
region = Rect2(720, 0, 240, 144) region = Rect2(720, 0, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_lrp4n"] [sub_resource type="AtlasTexture" id="AtlasTexture_lrp4n"]
atlas = ExtResource("2_6v2yy") atlas = ExtResource("3_tnfoa")
region = Rect2(960, 0, 240, 144) region = Rect2(960, 0, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_qnkpb"] [sub_resource type="AtlasTexture" id="AtlasTexture_qnkpb"]
atlas = ExtResource("2_6v2yy") atlas = ExtResource("3_tnfoa")
region = Rect2(1200, 0, 240, 144) region = Rect2(1200, 0, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_n03o5"] [sub_resource type="AtlasTexture" id="AtlasTexture_n03o5"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(0, 192, 240, 144) region = Rect2(0, 192, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_3k4i1"] [sub_resource type="AtlasTexture" id="AtlasTexture_3k4i1"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(240, 192, 240, 144) region = Rect2(240, 192, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_pg1lo"] [sub_resource type="AtlasTexture" id="AtlasTexture_pg1lo"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(480, 192, 240, 144) region = Rect2(480, 192, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_3b1y7"] [sub_resource type="AtlasTexture" id="AtlasTexture_3b1y7"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(720, 192, 240, 144) region = Rect2(720, 192, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_1jisb"] [sub_resource type="AtlasTexture" id="AtlasTexture_1jisb"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(960, 192, 240, 144) region = Rect2(960, 192, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_4lngy"] [sub_resource type="AtlasTexture" id="AtlasTexture_4lngy"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(1200, 192, 240, 144) region = Rect2(1200, 192, 240, 144)
[sub_resource type="AtlasTexture" id="AtlasTexture_xng4i"] [sub_resource type="AtlasTexture" id="AtlasTexture_xng4i"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(1440, 210, 96, 210) region = Rect2(1440, 210, 96, 210)
[sub_resource type="AtlasTexture" id="AtlasTexture_yy3vy"] [sub_resource type="AtlasTexture" id="AtlasTexture_yy3vy"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(1536, 210, 96, 210) region = Rect2(1536, 210, 96, 210)
[sub_resource type="AtlasTexture" id="AtlasTexture_cax1g"] [sub_resource type="AtlasTexture" id="AtlasTexture_cax1g"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(1632, 210, 96, 210) region = Rect2(1632, 210, 96, 210)
[sub_resource type="AtlasTexture" id="AtlasTexture_6dv7n"] [sub_resource type="AtlasTexture" id="AtlasTexture_6dv7n"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(1728, 210, 96, 210) region = Rect2(1728, 210, 96, 210)
[sub_resource type="AtlasTexture" id="AtlasTexture_7f8f4"] [sub_resource type="AtlasTexture" id="AtlasTexture_7f8f4"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(1824, 210, 96, 210) region = Rect2(1824, 210, 96, 210)
[sub_resource type="AtlasTexture" id="AtlasTexture_vy1dr"] [sub_resource type="AtlasTexture" id="AtlasTexture_vy1dr"]
atlas = ExtResource("1_hqmt6") atlas = ExtResource("2_ahai6")
region = Rect2(1920, 210, 96, 210) region = Rect2(1920, 210, 96, 210)
[sub_resource type="SpriteFrames" id="SpriteFrames_77j28"] [sub_resource type="SpriteFrames" id="SpriteFrames_77j28"]
@@ -213,7 +213,7 @@ height = 174.0
[node name="Area2D" type="Area2D"] [node name="Area2D" type="Area2D"]
position = Vector2(-664, 181) position = Vector2(-664, 181)
script = ExtResource("1_3v1b0") script = ExtResource("1_vkq5y")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
rotation = -0.00268924 rotation = -0.00268924
@@ -228,17 +228,14 @@ shape = SubResource("CapsuleShape2D_5yhvy")
[node name="shapeUp" type="CollisionShape2D" parent="."] [node name="shapeUp" type="CollisionShape2D" parent="."]
position = Vector2(1, -20) position = Vector2(1, -20)
rotation = -0.00268924 rotation = -0.00268924
scale = Vector2(1, 1)
shape = SubResource("CapsuleShape2D_bevht") shape = SubResource("CapsuleShape2D_bevht")
[node name="shapeLeft" type="CollisionShape2D" parent="."] [node name="shapeLeft" type="CollisionShape2D" parent="."]
position = Vector2(-29, 29) position = Vector2(-29, 29)
rotation = 1.5708 rotation = 1.5708
scale = Vector2(1, 1)
shape = SubResource("CapsuleShape2D_w52g8") shape = SubResource("CapsuleShape2D_w52g8")
[node name="shapeRight" type="CollisionShape2D" parent="."] [node name="shapeRight" type="CollisionShape2D" parent="."]
position = Vector2(28, 27) position = Vector2(28, 27)
rotation = 1.5708 rotation = 1.5708
scale = Vector2(1, 1)
shape = SubResource("CapsuleShape2D_j5vcu") shape = SubResource("CapsuleShape2D_j5vcu")

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://cl201baro5y5"] [gd_scene load_steps=3 format=3 uid="uid://cl201baro5y5"]
[ext_resource type="Script" path="res://scenes/pathFollow.gd" id="1_fbnn2"] [ext_resource type="Script" path="res://scenes/pathFollow.gd" id="1_fbnn2"]
[ext_resource type="PackedScene" uid="uid://bt1p311rn1h6q" path="res://vehicules/voiture.tscn" id="2_4yiv6"] [ext_resource type="PackedScene" uid="uid://bt1p311rn1h6q" path="res://vehicules/car.tscn" id="2_4yiv6"]
[node name="voiture_pnj" type="PathFollow2D"] [node name="voiture_pnj" type="PathFollow2D"]
position = Vector2(-411, 81) position = Vector2(-411, 81)