beta-1.3/restructure-files (#2)
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
8
Entities/Map Objects/Mechanisms/Scripts/arrow_target.gd
Normal file
8
Entities/Map Objects/Mechanisms/Scripts/arrow_target.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
extends Area2D
|
||||
|
||||
signal TargetHit
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if body is not CharacterBody2D:
|
||||
return
|
||||
TargetHit.emit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://6jls1eokv2to
|
||||
15
Entities/Map Objects/Mechanisms/Scripts/pressure_plate.gd
Normal file
15
Entities/Map Objects/Mechanisms/Scripts/pressure_plate.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends Area2D
|
||||
|
||||
signal PressurePlateTripped
|
||||
|
||||
@onready var animated_sprite_2d: AnimatedSprite2D = $AnimatedSprite2D
|
||||
|
||||
var activated := false
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if activated:
|
||||
return
|
||||
|
||||
activated = true
|
||||
animated_sprite_2d.play("activated")
|
||||
PressurePlateTripped.emit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://cxt7ht66jiac8
|
||||
13
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd
Normal file
13
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
extends Area2D
|
||||
class_name ShopItem
|
||||
|
||||
@export var check_location: Enums.CheckLocations
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta: float) -> void:
|
||||
pass
|
||||
1
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd.uid
Normal file
1
Entities/Map Objects/Mechanisms/Scripts/shop_item.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cggyjxrk4qqfm
|
||||
53
Entities/Map Objects/Mechanisms/arrow_target.tscn
Normal file
53
Entities/Map Objects/Mechanisms/arrow_target.tscn
Normal file
@@ -0,0 +1,53 @@
|
||||
[gd_scene format=3 uid="uid://b8m08wroe1qu2"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://k2htcxstdj5v" path="res://Assets/Spritesheets/Outdoor Objects/Arrow Target-Sheet.png" id="1_b0s8y"]
|
||||
[ext_resource type="Script" uid="uid://6jls1eokv2to" path="res://Entities/Map Objects/Mechanisms/Scripts/arrow_target.gd" id="1_uhut5"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_uhut5"]
|
||||
radius = 8.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b0s8y"]
|
||||
atlas = ExtResource("1_b0s8y")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_uhut5"]
|
||||
atlas = ExtResource("1_b0s8y")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_bfwsr"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b0s8y")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"hit",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_uhut5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"unhit",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="ArrowTarget" type="Area2D" unique_id=1856751990]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 4
|
||||
collision_mask = 4
|
||||
script = ExtResource("1_uhut5")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=522196069]
|
||||
shape = SubResource("CircleShape2D_uhut5")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1145493202]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 8)
|
||||
sprite_frames = SubResource("SpriteFrames_bfwsr")
|
||||
animation = &"unhit"
|
||||
autoplay = "unhit"
|
||||
offset = Vector2(0, -8)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
52
Entities/Map Objects/Mechanisms/pressure_plate.tscn
Normal file
52
Entities/Map Objects/Mechanisms/pressure_plate.tscn
Normal file
@@ -0,0 +1,52 @@
|
||||
[gd_scene format=3 uid="uid://b5t4h63xhuods"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cxt7ht66jiac8" path="res://Entities/Map Objects/Mechanisms/Scripts/pressure_plate.gd" id="1_po2h8"]
|
||||
[ext_resource type="Texture2D" uid="uid://dhtolttw5h33" path="res://Assets/Spritesheets/Mechanisms/Pressure Plate.png" id="1_ulio5"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ulio5"]
|
||||
size = Vector2(12, 10)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ulio5"]
|
||||
atlas = ExtResource("1_ulio5")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_po2h8"]
|
||||
atlas = ExtResource("1_ulio5")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_50pip"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ulio5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"activated",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_po2h8")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="PressurePlate" type="Area2D" unique_id=1213720400]
|
||||
y_sort_enabled = true
|
||||
collision_layer = 0
|
||||
script = ExtResource("1_po2h8")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=180813085]
|
||||
position = Vector2(0, -1)
|
||||
shape = SubResource("RectangleShape2D_ulio5")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=3182720]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, -7)
|
||||
sprite_frames = SubResource("SpriteFrames_50pip")
|
||||
autoplay = "default"
|
||||
offset = Vector2(0, 7)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
8
Entities/Map Objects/Mechanisms/shop_item.tscn
Normal file
8
Entities/Map Objects/Mechanisms/shop_item.tscn
Normal file
@@ -0,0 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://ddgeo3vwebqeg"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cggyjxrk4qqfm" path="res://Entities/Map Objects/Mechanisms/Scripts/shop_item.gd" id="1_0luup"]
|
||||
|
||||
[node name="ShopItem" type="Area2D" unique_id=1768344009]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_0luup")
|
||||
Reference in New Issue
Block a user