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

44 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2023-02-01 10:43:50 +01:00
[gd_scene load_steps=7 format=3]
2019-09-16 08:07:41 +02:00
2023-02-01 10:43:50 +01:00
[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"]
2019-09-16 08:07:41 +02:00
[sub_resource type="GDScript" id=1]
script/source = "extends Area2D
func _ready():
2023-02-01 10:43:50 +01:00
connect(\"body_entered\",Callable(self,\"_collide\"))
2019-09-16 08:07:41 +02:00
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 = [ {
2019-11-04 02:31:05 +01:00
"frames": [ ExtResource( 2 ), ExtResource( 3 ) ],
2019-09-16 08:07:41 +02:00
"loop": true,
"name": "default",
"speed": 10.0
} ]
[node name="Pickup" type="Node2D"]
2019-11-04 02:31:05 +01:00
script = ExtResource( 1 )
2019-09-16 08:07:41 +02:00
[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 )
2023-02-01 10:43:50 +01:00
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Area2D/CollisionShape2D"]
2019-09-16 08:07:41 +02:00
frames = SubResource( 3 )
frame = 1
playing = true