mirror of
https://github.com/mx42/my-gd-game.git
synced 2026-01-14 13:29:52 +01:00
feat: upgrade sound
This commit is contained in:
@@ -2,10 +2,15 @@ extends Node2D
|
||||
|
||||
@export var scene: PackedScene
|
||||
|
||||
var delay := 1.5
|
||||
|
||||
func _ready():
|
||||
$CanvasLayer/VBoxContainer/Score.text += str(Global.score);
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta: float) -> void:
|
||||
if Input.is_action_just_pressed("continue"):
|
||||
func _process(delta: float) -> void:
|
||||
delay -= delta;
|
||||
if delay <= 0:
|
||||
$CanvasLayer/VBoxContainer2/Label.visible = true;
|
||||
if Input.is_action_just_pressed("continue") and delay <= 0:
|
||||
get_tree().change_scene_to_packed(scene)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[ext_resource type="Script" path="res://scenes/game_over.gd" id="1_h2fw8"]
|
||||
[ext_resource type="PackedScene" uid="uid://byrjn2ta5gsld" path="res://scenes/level.tscn" id="2_latqh"]
|
||||
[ext_resource type="Texture2D" uid="uid://p8npigebbm88" path="res://assets/gfx/ship.png" id="3_rgq6y"]
|
||||
[ext_resource type="AudioStream" uid="uid://cr5eb0te0go26" path="res://assets/sfx/ship_explosion2.wav" id="4_0i6ac"]
|
||||
[ext_resource type="AudioStream" uid="uid://bthpukbec82b0" path="res://assets/sfx/ship_explosion3.wav" id="4_p52ie"]
|
||||
|
||||
[node name="GameOver" type="Node2D"]
|
||||
script = ExtResource("1_h2fw8")
|
||||
@@ -70,12 +70,14 @@ size_flags_vertical = 4
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="Label" type="Label" parent="CanvasLayer/VBoxContainer2"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "Press space to continue"
|
||||
text = "Press space or click the ship to continue"
|
||||
|
||||
[node name="ShipDestroyed" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("4_0i6ac")
|
||||
stream = ExtResource("4_p52ie")
|
||||
pitch_scale = 1.21
|
||||
autoplay = true
|
||||
|
||||
[connection signal="resized" from="CanvasLayer/BG" to="." method="_on_bg_resized"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=15 format=3 uid="uid://byrjn2ta5gsld"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://byrjn2ta5gsld"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://2kccnun8mkjv" path="res://scenes/player.tscn" id="1_35q1n"]
|
||||
[ext_resource type="Script" path="res://scenes/level.gd" id="1_bh63m"]
|
||||
@@ -10,7 +10,8 @@
|
||||
[ext_resource type="Texture2D" uid="uid://62bvbadc4yhc" path="res://assets/gfx/star5.png" id="7_vyiqk"]
|
||||
[ext_resource type="Texture2D" uid="uid://c53y4qb5nh44q" path="res://assets/gfx/star6.png" id="8_dy6n5"]
|
||||
[ext_resource type="PackedScene" uid="uid://drg5covf2vhj8" path="res://scenes/ui.tscn" id="10_ac25c"]
|
||||
[ext_resource type="AudioStream" uid="uid://cwsqbuoipmtad" path="res://assets/sfx/hurt2.wav" id="11_vh4gx"]
|
||||
[ext_resource type="AudioStream" uid="uid://dti8u25dovwo6" path="res://assets/sfx/hurt3.wav" id="11_7td5s"]
|
||||
[ext_resource type="AudioStream" uid="uid://ckbggocxpplkq" path="res://assets/bgm/VSO.mp3" id="12_p2d51"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_v16wl"]
|
||||
animations = [{
|
||||
@@ -118,7 +119,14 @@ metadata/_edit_lock_ = true
|
||||
[node name="UI" parent="." groups=["ui"] instance=ExtResource("10_ac25c")]
|
||||
|
||||
[node name="ShipHit" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("11_vh4gx")
|
||||
stream = ExtResource("11_7td5s")
|
||||
volume_db = -1.507
|
||||
pitch_scale = 1.17
|
||||
|
||||
[node name="Music" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("12_p2d51")
|
||||
volume_db = -2.01
|
||||
autoplay = true
|
||||
|
||||
[connection signal="laser" from="Player" to="." method="_on_player_laser"]
|
||||
[connection signal="timeout" from="MeteorTimer" to="." method="_on_meteor_timer_timeout"]
|
||||
|
||||
@@ -37,5 +37,5 @@ func _on_area_entered(area: Area2D) -> void:
|
||||
Global.score += 10;
|
||||
$MeteorImage.hide();
|
||||
can_collide = false;
|
||||
#await get_tree().create_timer(0.5).timeout;
|
||||
await get_tree().create_timer(0.5).timeout;
|
||||
call_deferred("queue_free");
|
||||
|
||||
@@ -17,6 +17,9 @@ polygon = PackedVector2Array(-11, 10, -11, 1, -9, -5, -2, -10, 6, -11, 11, -7, 1
|
||||
|
||||
[node name="DestroyMeteor" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("3_rgtxm")
|
||||
volume_db = -4.657
|
||||
pitch_scale = 1.2
|
||||
max_polyphony = 2
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://p8npigebbm88" path="res://assets/gfx/ship.png" id="1_6r50y"]
|
||||
[ext_resource type="Script" path="res://scenes/player.gd" id="1_spn58"]
|
||||
[ext_resource type="AudioStream" uid="uid://bio5bv0mi006i" path="res://assets/sfx/shoot2.wav" id="3_650e3"]
|
||||
[ext_resource type="AudioStream" uid="uid://c03kghmku12vn" path="res://assets/sfx/shoot3.wav" id="3_21m3o"]
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_gc25u"]
|
||||
lifetime_randomness = 0.29
|
||||
@@ -29,7 +29,9 @@ polygon = PackedVector2Array(-13.5543, 8.72725, 0.445736, -11.2728, 14.4457, 8.7
|
||||
position = Vector2(0, -21)
|
||||
|
||||
[node name="LaserSound" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("3_650e3")
|
||||
stream = ExtResource("3_21m3o")
|
||||
volume_db = -9.831
|
||||
pitch_scale = 1.24
|
||||
|
||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
|
||||
process_material = SubResource("ParticleProcessMaterial_gc25u")
|
||||
|
||||
Reference in New Issue
Block a user