mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-12 11:55:53 +00:00
Boxswitch with state
This commit is contained in:
parent
036a36a80f
commit
87645f2617
14 changed files with 278 additions and 37 deletions
53
Scenes/Interactable/Switch_Box.tscn
Normal file
53
Scenes/Interactable/Switch_Box.tscn
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://cl4r3t4c1klv7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://booisvod4sc6s" path="res://Scripts/Interactables/StateSwitch.cs" id="1_75bmt"]
|
||||
[ext_resource type="Texture2D" uid="uid://cx4xcuxlnwqvj" path="res://Sprites/Interactables/BoxSwitch.png" id="2_ffjgg"]
|
||||
[ext_resource type="AudioStream" uid="uid://bjvklk7qmlivd" path="res://SFX/288963__littlerobotsoundfactory__click_electronic_14.wav" id="3_ffjgg"]
|
||||
[ext_resource type="Script" uid="uid://b5sanpv5j7wyd" path="res://Scripts/Interactables/Modules/SwitchSpriteChanger.cs" id="3_sqpe7"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_vvpve"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_01nkk"]
|
||||
atlas = ExtResource("2_ffjgg")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_422n6"]
|
||||
atlas = ExtResource("2_ffjgg")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_l6x2t"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_01nkk")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Off",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_422n6")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"On",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="SwitchBox" type="Area2D" groups=["Interactable"]]
|
||||
collision_layer = 4
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_75bmt")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_vvpve")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." node_paths=PackedStringArray("Switch")]
|
||||
sprite_frames = SubResource("SpriteFrames_l6x2t")
|
||||
animation = &"On"
|
||||
autoplay = "Off"
|
||||
script = ExtResource("3_sqpe7")
|
||||
Switch = NodePath("..")
|
||||
|
||||
[node name="ActivationSound" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource("3_ffjgg")
|
||||
Loading…
Add table
Add a link
Reference in a new issue