simplaudio birthday
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=80 format=3 uid="uid://b2sygl55s6fng"]
|
||||
[gd_scene load_steps=81 format=3 uid="uid://b2sygl55s6fng"]
|
||||
|
||||
[ext_resource type="Script" path="res://main.gd" id="1_ubs1p"]
|
||||
[ext_resource type="Texture2D" uid="uid://b8on1case224h" path="res://LoopPressed.png" id="2_iolk5"]
|
||||
@@ -190,6 +190,10 @@ shadow_size = 4
|
||||
shadow_color = Color(0.290196, 0.290196, 0.290196, 0.270588)
|
||||
shadow_offset = Vector2(2, 3)
|
||||
|
||||
[sub_resource type="Curve" id="Curve_ilc1k"]
|
||||
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.257642, 1), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||
point_count = 3
|
||||
|
||||
[sub_resource type="Curve" id="Curve_wqjqk"]
|
||||
_data = [Vector2(0, 0), 0.0, 16.8231, 0, 0, Vector2(0.119342, 1), 0.0, 0.0, 0, 0, Vector2(0.991769, 1), 8.04663e-07, 0.0, 0, 0]
|
||||
point_count = 3
|
||||
@@ -1284,6 +1288,7 @@ anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
script = ExtResource("38_pitc3")
|
||||
opacitycurve = SubResource("Curve_ilc1k")
|
||||
|
||||
[node name="BirthdayParticles" type="GPUParticles2D" parent="BirthdayContainer"]
|
||||
emitting = false
|
||||
@@ -1296,7 +1301,8 @@ visibility_rect = Rect2(-750, -750, 1500, 1000)
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="BirthdayContainer"]
|
||||
stream = ExtResource("39_3er0p")
|
||||
volume_db = -17.885
|
||||
volume_db = -10.0
|
||||
bus = &"Music"
|
||||
|
||||
[node name="BirthdayHappy" type="Label" parent="."]
|
||||
visible = false
|
||||
@@ -1312,7 +1318,7 @@ offset_right = 62.5
|
||||
offset_bottom = 11.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Happy Birthday!"
|
||||
text = "Happy Birthday Simplaudio!"
|
||||
label_settings = SubResource("LabelSettings_f1d3e")
|
||||
|
||||
[node name="PlayingNow" type="Window" parent="."]
|
||||
|
||||
+13
-11
@@ -3,6 +3,8 @@ extends Control
|
||||
@onready var birthday_particles: GPUParticles2D = $BirthdayParticles
|
||||
@onready var audio_stream_player: AudioStreamPlayer = $AudioStreamPlayer
|
||||
@onready var birthday_happy: Label = $"../BirthdayHappy"
|
||||
@export var opacitycurve:Curve
|
||||
var opacity:float = 1
|
||||
|
||||
var awaitingJumpscare:bool
|
||||
var IsFocused:bool
|
||||
@@ -11,12 +13,11 @@ func _ready() -> void:
|
||||
birthday_happy.hide()
|
||||
print("user: ",DiscordRPC.get_current_user().get("username"))
|
||||
var bday:bool
|
||||
if owner.DiscordUsername == "woostudiosjohn":
|
||||
if Time.get_datetime_dict_from_system().day == 5:
|
||||
if Time.get_datetime_dict_from_system().month == 11:
|
||||
await get_tree().create_timer(0.2).timeout
|
||||
awaitingJumpscare = true
|
||||
bday = true
|
||||
if Time.get_datetime_dict_from_system().day == 29:
|
||||
if Time.get_datetime_dict_from_system().month == 6:
|
||||
await get_tree().create_timer(0.2).timeout
|
||||
awaitingJumpscare = true
|
||||
bday = true
|
||||
|
||||
func _notification(what):
|
||||
if what == get_tree().NOTIFICATION_APPLICATION_FOCUS_IN:
|
||||
@@ -27,9 +28,10 @@ func _notification(what):
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if awaitingJumpscare && IsFocused:
|
||||
birthday_happy.show()
|
||||
awaitingJumpscare = false
|
||||
birthday_particles.emitting = true
|
||||
audio_stream_player.play()
|
||||
birthday_happy.show()
|
||||
awaitingJumpscare = false
|
||||
birthday_particles.emitting = true
|
||||
audio_stream_player.play()
|
||||
if !awaitingJumpscare:
|
||||
birthday_happy.modulate.a -= delta/5
|
||||
opacity -= delta/5
|
||||
birthday_happy.modulate.a = opacitycurve.sample_baked(opacity)
|
||||
|
||||
Reference in New Issue
Block a user