Chests and strafing speed

This commit is contained in:
Marco 2025-01-28 14:05:38 +01:00
commit b645e1724e
17 changed files with 286 additions and 21 deletions

View file

@ -0,0 +1,108 @@
[gd_scene load_steps=15 format=3 uid="uid://djf0y08ix66fn"]
[ext_resource type="Script" path="res://Scenes/Interactable.cs" id="1_4p5d3"]
[ext_resource type="Texture2D" uid="uid://qeh4ai8h6sw5" path="res://Sprites/Chest.png" id="2_w7a1a"]
[ext_resource type="Script" path="res://Scripts/Pickupper.cs" id="3_qro6k"]
[ext_resource type="Script" path="res://Scripts/Resources/LootItem.cs" id="4_rcd61"]
[sub_resource type="AtlasTexture" id="AtlasTexture_elja3"]
atlas = ExtResource("2_w7a1a")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_nyoe2"]
atlas = ExtResource("2_w7a1a")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_f10r8"]
atlas = ExtResource("2_w7a1a")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_faho7"]
atlas = ExtResource("2_w7a1a")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_yfpr1"]
atlas = ExtResource("2_w7a1a")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_x1bfm"]
atlas = ExtResource("2_w7a1a")
region = Rect2(16, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_cirgn"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_elja3")
}],
"loop": true,
"name": &"Closed",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_nyoe2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_f10r8")
}],
"loop": true,
"name": &"Closing",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_faho7")
}],
"loop": true,
"name": &"Open",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_yfpr1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_x1bfm")
}],
"loop": true,
"name": &"Opening",
"speed": 5.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_ihal6"]
radius = 16.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_isrvb"]
size = Vector2(12, 10)
[sub_resource type="Resource" id="Resource_0qq1f"]
script = ExtResource("4_rcd61")
Item = 3
Amount = 10
[node name="Chest" type="Node2D"]
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_cirgn")
animation = &"Closed"
[node name="Interactable" type="Area2D" parent="." node_paths=PackedStringArray("Target") groups=["Interactable"]]
script = ExtResource("1_4p5d3")
Target = NodePath("../Pickupper")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Interactable"]
shape = SubResource("CircleShape2D_ihal6")
[node name="RigidBody2D" type="RigidBody2D" parent="."]
collision_layer = 64
collision_mask = 10
gravity_scale = 0.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
position = Vector2(0, -3)
shape = SubResource("RectangleShape2D_isrvb")
[node name="Pickupper" type="Node2D" parent="."]
script = ExtResource("3_qro6k")
LootTable = [SubResource("Resource_0qq1f")]

View file

@ -3,7 +3,7 @@
[ext_resource type="Script" path="res://Scenes/Interactable.cs" id="1_g3j01"]
[ext_resource type="Texture2D" uid="uid://d24g1qb40t72l" path="res://Sprites/Button_Small.png" id="2_7m30w"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_x0adl"]
[sub_resource type="CircleShape2D" id="CircleShape2D_vvpve"]
[node name="ControlPad" type="Area2D" groups=["Interactable"]]
collision_layer = 4
@ -11,7 +11,7 @@ collision_mask = 2
script = ExtResource("1_g3j01")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_x0adl")
shape = SubResource("CircleShape2D_vvpve")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_7m30w")