glitch-in-the-system/nodes/pickup.tscn

44 lines
1.1 KiB
Plaintext

[gd_scene load_steps=7 format=3]
[ext_resource type="Script" path="res://scripts/pickup.gd" id="1"]
[ext_resource type="Texture2D" uid="uid://nw1eg7vb3df6" path="res://assets/art/pickup1.png" id="2"]
[ext_resource type="Texture2D" uid="uid://ibtidhnw6mnj" path="res://assets/art/pickup2.png" id="3"]
[sub_resource type="GDScript" id=1]
script/source = "extends Area2D
func _ready():
connect(\"body_entered\",Callable(self,\"_collide\"))
func _collide(body):
if body.has_method(\"pickupCoin\"):
body.pickupCoin()
queue_free()"
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 6, 6 )
[sub_resource type="SpriteFrames" id=3]
animations = [ {
"frames": [ ExtResource( 2 ), ExtResource( 3 ) ],
"loop": true,
"name": "default",
"speed": 10.0
} ]
[node name="Pickup" type="Node2D"]
script = ExtResource( 1 )
[node name="Area2D" type="Area2D" parent="."]
gravity = 0.0
angular_damp = 0.0
script = SubResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource( 2 )
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Area2D/CollisionShape2D"]
frames = SubResource( 3 )
frame = 1
playing = true