feat: small world and interactibles
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 6s
Create tag and build when new code gets to main / Export (push) Successful in 3m25s

This commit is contained in:
2025-06-28 10:23:35 +02:00
parent 00037d0270
commit e59f0e9e6a
2769 changed files with 52148 additions and 10 deletions

213
scenes/player/base.tres Normal file
View File

@ -0,0 +1,213 @@
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=39 format=3 uid="uid://7bmpcn0dxwr8"]
[ext_resource type="Script" uid="uid://cpplm41b5bt6m" path="res://addons/guide/guide_action_mapping.gd" id="1_jg5dr"]
[ext_resource type="Script" uid="uid://dsa1dnifd6w32" path="res://addons/guide/guide_mapping_context.gd" id="2_curyy"]
[ext_resource type="Resource" uid="uid://brqtomhme6lci" path="res://scenes/player/move.tres" id="2_y2l1a"]
[ext_resource type="Script" uid="uid://mtx1unc2aqn7" path="res://addons/guide/guide_input_mapping.gd" id="3_cujot"]
[ext_resource type="Script" uid="uid://cw71o87tvdx3q" path="res://addons/guide/inputs/guide_input_key.gd" id="4_s2miq"]
[ext_resource type="Script" uid="uid://bl8rjl4oaldje" path="res://addons/guide/modifiers/guide_modifier.gd" id="5_kgy30"]
[ext_resource type="Script" uid="uid://bm5gjgadon6hb" path="res://addons/guide/modifiers/guide_modifier_input_swizzle.gd" id="6_4q282"]
[ext_resource type="Script" uid="uid://x74mnwgr08a7" path="res://addons/guide/triggers/guide_trigger.gd" id="6_rn6pu"]
[ext_resource type="Script" uid="uid://ckggy40lm0vjc" path="res://addons/guide/modifiers/guide_modifier_negate.gd" id="7_cljr7"]
[ext_resource type="Resource" uid="uid://hduu8jtu7fio" path="res://scenes/player/interact.tres" id="7_s2miq"]
[ext_resource type="Script" uid="uid://vgjlx6p007lp" path="res://addons/guide/inputs/guide_input_mouse_button.gd" id="8_kgy30"]
[ext_resource type="Script" uid="uid://b52rqq28tuqpg" path="res://addons/guide/triggers/guide_trigger_pressed.gd" id="10_4q282"]
[sub_resource type="Resource" id="Resource_4q282"]
script = ExtResource("4_s2miq")
key = 87
shift = false
control = false
alt = false
meta = false
allow_additional_modifiers = true
[sub_resource type="Resource" id="Resource_ebhmq"]
script = ExtResource("6_4q282")
order = 0
[sub_resource type="Resource" id="Resource_pta5b"]
script = ExtResource("7_cljr7")
x = true
y = true
z = true
[sub_resource type="Resource" id="Resource_cljr7"]
script = ExtResource("3_cujot")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_4q282")
modifiers = Array[ExtResource("5_kgy30")]([SubResource("Resource_ebhmq"), SubResource("Resource_pta5b")])
triggers = Array[ExtResource("6_rn6pu")]([])
[sub_resource type="Resource" id="Resource_h50d8"]
script = ExtResource("4_s2miq")
key = 83
shift = false
control = false
alt = false
meta = false
allow_additional_modifiers = true
[sub_resource type="Resource" id="Resource_xq4ri"]
script = ExtResource("6_4q282")
order = 0
[sub_resource type="Resource" id="Resource_5eoei"]
script = ExtResource("3_cujot")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_h50d8")
modifiers = Array[ExtResource("5_kgy30")]([SubResource("Resource_xq4ri")])
triggers = Array[ExtResource("6_rn6pu")]([])
[sub_resource type="Resource" id="Resource_y4vw0"]
script = ExtResource("4_s2miq")
key = 65
shift = false
control = false
alt = false
meta = false
allow_additional_modifiers = true
[sub_resource type="Resource" id="Resource_qkgtu"]
script = ExtResource("7_cljr7")
x = true
y = true
z = true
[sub_resource type="Resource" id="Resource_jsnfs"]
script = ExtResource("3_cujot")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_y4vw0")
modifiers = Array[ExtResource("5_kgy30")]([SubResource("Resource_qkgtu")])
triggers = Array[ExtResource("6_rn6pu")]([])
[sub_resource type="Resource" id="Resource_phmid"]
script = ExtResource("4_s2miq")
key = 68
shift = false
control = false
alt = false
meta = false
allow_additional_modifiers = true
[sub_resource type="Resource" id="Resource_w7yxy"]
script = ExtResource("3_cujot")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_phmid")
modifiers = Array[ExtResource("5_kgy30")]([])
triggers = Array[ExtResource("6_rn6pu")]([])
[sub_resource type="Resource" id="Resource_riyo6"]
script = ExtResource("1_jg5dr")
action = ExtResource("2_y2l1a")
input_mappings = Array[ExtResource("3_cujot")]([SubResource("Resource_cljr7"), SubResource("Resource_5eoei"), SubResource("Resource_jsnfs"), SubResource("Resource_w7yxy")])
[sub_resource type="Resource" id="Resource_rn6pu"]
script = ExtResource("4_s2miq")
key = 70
shift = false
control = false
alt = false
meta = false
allow_additional_modifiers = true
[sub_resource type="Resource" id="Resource_0ggvo"]
script = ExtResource("10_4q282")
actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_nx2mb"]
script = ExtResource("3_cujot")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_rn6pu")
modifiers = Array[ExtResource("5_kgy30")]([])
triggers = Array[ExtResource("6_rn6pu")]([SubResource("Resource_0ggvo")])
[sub_resource type="Resource" id="Resource_1l7lq"]
script = ExtResource("4_s2miq")
key = 32
shift = false
control = false
alt = false
meta = false
allow_additional_modifiers = true
[sub_resource type="Resource" id="Resource_o61bo"]
script = ExtResource("10_4q282")
actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_agw8q"]
script = ExtResource("3_cujot")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_1l7lq")
modifiers = Array[ExtResource("5_kgy30")]([])
triggers = Array[ExtResource("6_rn6pu")]([SubResource("Resource_o61bo")])
[sub_resource type="Resource" id="Resource_3fn0f"]
script = ExtResource("8_kgy30")
button = 1
[sub_resource type="Resource" id="Resource_kkvn6"]
script = ExtResource("10_4q282")
actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_1utwo"]
script = ExtResource("3_cujot")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_3fn0f")
modifiers = Array[ExtResource("5_kgy30")]([])
triggers = Array[ExtResource("6_rn6pu")]([SubResource("Resource_kkvn6")])
[sub_resource type="Resource" id="Resource_qbxoc"]
script = ExtResource("4_s2miq")
key = 69
shift = false
control = false
alt = false
meta = false
allow_additional_modifiers = true
[sub_resource type="Resource" id="Resource_cl1yx"]
script = ExtResource("10_4q282")
actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_ni3oo"]
script = ExtResource("3_cujot")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_qbxoc")
modifiers = Array[ExtResource("5_kgy30")]([])
triggers = Array[ExtResource("6_rn6pu")]([SubResource("Resource_cl1yx")])
[sub_resource type="Resource" id="Resource_n1cjy"]
script = ExtResource("1_jg5dr")
action = ExtResource("7_s2miq")
input_mappings = Array[ExtResource("3_cujot")]([SubResource("Resource_nx2mb"), SubResource("Resource_agw8q"), SubResource("Resource_1utwo"), SubResource("Resource_ni3oo")])
[resource]
script = ExtResource("2_curyy")
display_name = ""
mappings = Array[ExtResource("1_jg5dr")]([SubResource("Resource_riyo6"), SubResource("Resource_n1cjy")])
metadata/_custom_type_script = "uid://dsa1dnifd6w32"

View File

@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://hduu8jtu7fio"]
[ext_resource type="Script" uid="uid://cluhc11vixkf1" path="res://addons/guide/guide_action.gd" id="1_5cc5f"]
[resource]
script = ExtResource("1_5cc5f")
name = &""
action_value_type = 0
block_lower_priority_actions = true
emit_as_godot_actions = false
is_remappable = false
display_name = ""
display_category = ""
metadata/_custom_type_script = "uid://cluhc11vixkf1"

14
scenes/player/move.tres Normal file
View File

@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://brqtomhme6lci"]
[ext_resource type="Script" uid="uid://cluhc11vixkf1" path="res://addons/guide/guide_action.gd" id="1_swh3u"]
[resource]
script = ExtResource("1_swh3u")
name = &""
action_value_type = 2
block_lower_priority_actions = true
emit_as_godot_actions = false
is_remappable = false
display_name = ""
display_category = ""
metadata/_custom_type_script = "uid://cluhc11vixkf1"

50
scenes/player/player.gd Normal file
View File

@ -0,0 +1,50 @@
extends CharacterBody2D
@export var move: GUIDEAction
@export var interact: GUIDEAction
@export var walk_speed = 300.0
@onready var animated_sprite_2d: AnimatedSprite2D = $AnimatedSprite2D
var current_interactible: Interactible = null
var is_sneaking: bool = false
func _ready() -> void:
interact.triggered.connect(on_interact_triggered)
func on_interact_triggered() -> void:
if current_interactible == null:
return
SceneLoader.load_scene(current_interactible.scene_to_trigger)
func _on_interactible_found(area: Area2D) -> void:
current_interactible = area as Interactible
func _physics_process(delta: float) -> void:
var direction = move.value_axis_2d
velocity = direction * walk_speed
if velocity.x > 0:
animated_sprite_2d.flip_h = false
if velocity.x < 0:
animated_sprite_2d.flip_h = true
if velocity.length() == 0:
if is_sneaking:
animated_sprite_2d.play("idle_sneak")
else:
animated_sprite_2d.play("idle")
if velocity.length() > 0:
if is_sneaking:
animated_sprite_2d.play("sneak")
else:
animated_sprite_2d.play("run")
move_and_slide()
func _on_area_2d_area_exited(area: Area2D) -> void:
current_interactible = null # Replace with function body.

View File

@ -0,0 +1 @@
uid://dco5ddglmk1je

View File

@ -1,10 +1,20 @@
[gd_scene load_steps=21 format=3 uid="uid://4ye80a3tugk6"]
[gd_scene load_steps=29 format=3 uid="uid://4ye80a3tugk6"]
[ext_resource type="Texture2D" uid="uid://d1booebooduen" path="res://scenes/player/assets/dino/sheets/DinoSprites - tard.png" id="1_8afob"]
[ext_resource type="Script" uid="uid://dco5ddglmk1je" path="res://scenes/player/player.gd" id="1_dovo2"]
[ext_resource type="Resource" uid="uid://brqtomhme6lci" path="res://scenes/player/move.tres" id="2_gmlin"]
[ext_resource type="Resource" uid="uid://hduu8jtu7fio" path="res://scenes/player/interact.tres" id="3_lvxji"]
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="5_qek5x"]
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="6_5gtgg"]
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="7_h17s1"]
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="8_je7p5"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_dovo2"]
radius = 5.0
height = 16.0
radius = 6.0
height = 14.0
[sub_resource type="CircleShape2D" id="CircleShape2D_qek5x"]
radius = 16.0
[sub_resource type="AtlasTexture" id="AtlasTexture_gmlin"]
atlas = ExtResource("1_8afob")
@ -149,13 +159,89 @@ animations = [{
}]
[node name="Player" type="CharacterBody2D"]
collision_layer = 3
collision_mask = 5
motion_mode = 1
script = ExtResource("1_dovo2")
move = ExtResource("2_gmlin")
interact = ExtResource("3_lvxji")
walk_speed = null
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 2)
shape = SubResource("CapsuleShape2D_dovo2")
[node name="Area2D" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("CircleShape2D_qek5x")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_8ydkj")
animation = &"idle"
frame_progress = 0.162357
frame_progress = 0.146964
[node name="Camera2D" type="Camera2D" parent="."]
position_smoothing_enabled = true
[node name="StateChart" type="Node" parent="."]
script = ExtResource("5_qek5x")
metadata/_custom_type_script = "uid://couw105c3bde4"
[node name="CompoundState" type="Node" parent="StateChart"]
script = ExtResource("6_5gtgg")
initial_state = NodePath("idle")
metadata/_custom_type_script = "uid://jk2jm1g6q853"
[node name="idle" type="Node" parent="StateChart/CompoundState"]
script = ExtResource("7_h17s1")
[node name="StartRun" type="Node" parent="StateChart/CompoundState/idle"]
script = ExtResource("8_je7p5")
to = NodePath("../../run")
event = &"run"
delay_in_seconds = "0.0"
[node name="idle_sneak" type="Node" parent="StateChart/CompoundState"]
script = ExtResource("7_h17s1")
[node name="StartRun" type="Node" parent="StateChart/CompoundState/idle_sneak"]
script = ExtResource("8_je7p5")
to = NodePath("../../sneak")
event = &"run"
delay_in_seconds = "0.0"
[node name="run" type="Node" parent="StateChart/CompoundState"]
script = ExtResource("7_h17s1")
[node name="StopRun" type="Node" parent="StateChart/CompoundState/run"]
script = ExtResource("8_je7p5")
to = NodePath("../../idle")
event = &"idle"
delay_in_seconds = "0.0"
[node name="ToSneak" type="Node" parent="StateChart/CompoundState/run"]
script = ExtResource("8_je7p5")
to = NodePath("../../sneak")
event = &"sneak"
delay_in_seconds = "0.0"
[node name="sneak" type="Node" parent="StateChart/CompoundState"]
script = ExtResource("7_h17s1")
[node name="ToNormal" type="Node" parent="StateChart/CompoundState/sneak"]
script = ExtResource("8_je7p5")
to = NodePath("../../run")
event = &"run"
delay_in_seconds = "0.0"
[node name="StopRun" type="Node" parent="StateChart/CompoundState/sneak"]
script = ExtResource("8_je7p5")
to = NodePath("../../idle_sneak")
event = &"idle"
delay_in_seconds = "0.0"
[connection signal="area_entered" from="Area2D" to="." method="_on_interactible_found"]
[connection signal="area_exited" from="Area2D" to="." method="_on_area_2d_area_exited"]