it works
This commit is contained in:
223
scenes/coin.tscn
Normal file
223
scenes/coin.tscn
Normal file
@@ -0,0 +1,223 @@
|
||||
[gd_scene load_steps=21 format=3 uid="uid://rbfbwxr7wsro"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dafe64tmpvrbe" path="res://scripts/coin.gd" id="1_i64fm"]
|
||||
[ext_resource type="Texture2D" uid="uid://bumwkwuxq07qe" path="res://assets/brackeys_platformer_assets/sprites/coin.png" id="1_rwqht"]
|
||||
[ext_resource type="AudioStream" uid="uid://p8u882irnnt1" path="res://assets/brackeys_platformer_assets/sounds/coin.wav" id="3_11l1o"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_i64fm"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_11l1o"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_d14el"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1ikuy"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wnlwo"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jig8b"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xmuha"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(96, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kfxoj"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(112, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jsmju"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(128, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s0mny"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(144, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_7cc30"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(160, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rojmm"]
|
||||
atlas = ExtResource("1_rwqht")
|
||||
region = Rect2(176, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_kahox"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_i64fm")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_11l1o")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_d14el")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1ikuy")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wnlwo")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_jig8b")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xmuha")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_kfxoj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_jsmju")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s0mny")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_7cc30")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_rojmm")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 11.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_kahox"]
|
||||
radius = 5.09902
|
||||
|
||||
[sub_resource type="Animation" id="Animation_11l1o"]
|
||||
resource_name = "pickup_sound"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("AnimatedSprite2D:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("CollisionShape2D:disabled")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("PickupSound:playing")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/3/type = "method"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath(".")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0.866667),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"queue_free"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_d14el"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("AnimatedSprite2D:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("CollisionShape2D:disabled")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("PickupSound:playing")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_1ikuy"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_d14el"),
|
||||
&"pickup_sound": SubResource("Animation_11l1o")
|
||||
}
|
||||
|
||||
[node name="Coin" type="Node2D"]
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_i64fm")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Area2D"]
|
||||
sprite_frames = SubResource("SpriteFrames_kahox")
|
||||
autoplay = "default"
|
||||
frame_progress = 0.772651
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
shape = SubResource("CircleShape2D_kahox")
|
||||
|
||||
[node name="PickupSound" type="AudioStreamPlayer2D" parent="Area2D"]
|
||||
stream = ExtResource("3_11l1o")
|
||||
bus = &"Sfx"
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Area2D"]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_1ikuy")
|
||||
}
|
||||
|
||||
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]
|
||||
Reference in New Issue
Block a user