diff --git a/art/background.png b/art/background.png index 1553ceb..1e2218e 100644 Binary files a/art/background.png and b/art/background.png differ diff --git a/art/player.png b/art/player.png index c7b90a9..88153af 100644 Binary files a/art/player.png and b/art/player.png differ diff --git a/coin.gd b/coin.gd index 6841e94..a9e2199 100644 --- a/coin.gd +++ b/coin.gd @@ -11,5 +11,8 @@ func _process(delta: float) -> void: func on_contact(body: Node2D) -> void: print(body) + $AudioStreamPlayer2D.play(0) + visible = false %Player2D.coins += 1 + await get_tree().create_timer(0.2).timeout queue_free() diff --git a/coin.tscn b/coin.tscn index 2ef59a6..f0a8069 100644 --- a/coin.tscn +++ b/coin.tscn @@ -2,6 +2,7 @@ [ext_resource type="Script" uid="uid://cvboxlqkhn1ef" path="res://coin.gd" id="1_0t63x"] [ext_resource type="Texture2D" uid="uid://dftfxivu3peog" path="res://art/coin.png" id="1_d5gmh"] +[ext_resource type="AudioStream" uid="uid://f2xmq6cgiiwj" path="res://sound/coin.wav" id="3_v7riw"] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_6qpsl"] radius = 7.0 @@ -18,4 +19,8 @@ texture = ExtResource("1_d5gmh") [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1865546056] shape = SubResource("CapsuleShape2D_6qpsl") +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=1778061188] +stream = ExtResource("3_v7riw") +volume_db = 1.0 + [connection signal="body_entered" from="Area2D" to="." method="on_contact"] diff --git a/coin.tscn3893402968.tmp b/coin.tscn3893402968.tmp new file mode 100644 index 0000000..f0a8069 --- /dev/null +++ b/coin.tscn3893402968.tmp @@ -0,0 +1,26 @@ +[gd_scene format=3 uid="uid://kstmxoa4dx55"] + +[ext_resource type="Script" uid="uid://cvboxlqkhn1ef" path="res://coin.gd" id="1_0t63x"] +[ext_resource type="Texture2D" uid="uid://dftfxivu3peog" path="res://art/coin.png" id="1_d5gmh"] +[ext_resource type="AudioStream" uid="uid://f2xmq6cgiiwj" path="res://sound/coin.wav" id="3_v7riw"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_6qpsl"] +radius = 7.0 +height = 20.0 + +[node name="Coin" type="Node2D" unique_id=1739014101] +script = ExtResource("1_0t63x") + +[node name="Sprite2D" type="Sprite2D" parent="." unique_id=813041394] +texture = ExtResource("1_d5gmh") + +[node name="Area2D" type="Area2D" parent="." unique_id=170499029] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1865546056] +shape = SubResource("CapsuleShape2D_6qpsl") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." unique_id=1778061188] +stream = ExtResource("3_v7riw") +volume_db = 1.0 + +[connection signal="body_entered" from="Area2D" to="." method="on_contact"] diff --git a/player_2d.tscn b/player_2d.tscn index 946bdfc..860eade 100644 --- a/player_2d.tscn +++ b/player_2d.tscn @@ -14,7 +14,7 @@ script = ExtResource("1_sy00s") repeat_size = Vector2(1, 1) [node name="Sprite2D" type="Sprite2D" parent="Parallax2D" unique_id=1267606565] -scale = Vector2(100, 100) +scale = Vector2(3, 3) texture = ExtResource("3_p3026") [node name="Camera2D" type="Camera2D" parent="." unique_id=962368438] diff --git a/sound/coin.ceol b/sound/coin.ceol new file mode 100644 index 0000000..d1375dd --- /dev/null +++ b/sound/coin.ceol @@ -0,0 +1 @@ +3,0,0,0,120,16,4,1,217,0,1,128,0,256,1,0,0,0,1,2,71,1,0,0,79,2,0,0,0,1,0,1,0,-1,-1,-1,-1,-1,-1,-1, \ No newline at end of file diff --git a/sound/coin.mid b/sound/coin.mid new file mode 100644 index 0000000..85c2692 Binary files /dev/null and b/sound/coin.mid differ diff --git a/sound/coin.wav b/sound/coin.wav new file mode 100644 index 0000000..de615bb Binary files /dev/null and b/sound/coin.wav differ diff --git a/sound/coin.wav.import b/sound/coin.wav.import new file mode 100644 index 0000000..b7ba6e1 --- /dev/null +++ b/sound/coin.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://f2xmq6cgiiwj" +path="res://.godot/imported/coin.wav-fcd7aec7959d3f43bcba358fb78d1cf1.sample" + +[deps] + +source_file="res://sound/coin.wav" +dest_files=["res://.godot/imported/coin.wav-fcd7aec7959d3f43bcba358fb78d1cf1.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/sound/stones.mid b/sound/stones.mid new file mode 100644 index 0000000..7f73d3e Binary files /dev/null and b/sound/stones.mid differ diff --git a/sound/stones.wav b/sound/stones.wav new file mode 100644 index 0000000..90948c6 Binary files /dev/null and b/sound/stones.wav differ diff --git a/sound/stones.wav.import b/sound/stones.wav.import new file mode 100644 index 0000000..17c5ceb --- /dev/null +++ b/sound/stones.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://cygaxoo4wb3t6" +path="res://.godot/imported/stones.wav-7997832a36ac3b5f76c1d2e10e25b972.sample" + +[deps] + +source_file="res://sound/stones.wav" +dest_files=["res://.godot/imported/stones.wav-7997832a36ac3b5f76c1d2e10e25b972.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/world.tscn b/world.tscn index d84cdf0..6d6bd1a 100644 --- a/world.tscn +++ b/world.tscn @@ -64,6 +64,9 @@ position = Vector2(55, 59) [node name="Tutorial" type="Node2D" parent="." unique_id=1391494772] +[node name="Spike" parent="Tutorial" unique_id=1505280758 instance=ExtResource("12_k3n1d")] +position = Vector2(162, 184.13078) + [node name="Teleporter1" parent="Tutorial" unique_id=1201409437 instance=ExtResource("4_gbfbk")] position = Vector2(149, 91.57307) paired_teleporter = "A" @@ -111,6 +114,3 @@ position = Vector2(880, 399) [node name="LongBlock6" parent="." unique_id=1328813509 instance=ExtResource("6_dwbse")] position = Vector2(1368, 401) - -[node name="Spike" parent="." unique_id=1505280758 instance=ExtResource("12_k3n1d")] -position = Vector2(162, 184.1308)