From 8badd4a23fdabfe1a63337a6e35e6f36ddcad962 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 28 Jan 2024 19:43:27 +0100 Subject: [PATCH] FIN --- ressources/sounds/AdBlockNot.wav.import | 24 ++++++++++++++++++++++++ scenes/game/ads/Ads_music.tscn | 2 +- scenes/game/screen.tscn | 14 +++++++++++++- scenes/game/victoire.tscn | 3 +++ scenes/menu/menu.gd | 6 +----- scenes/menu/menu.tscn | 9 ++++++++- scripts/ads/ads_music.gd | 4 ++++ scripts/game.gd | 9 +++++++-- 8 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 ressources/sounds/AdBlockNot.wav.import create mode 100644 scenes/game/victoire.tscn diff --git a/ressources/sounds/AdBlockNot.wav.import b/ressources/sounds/AdBlockNot.wav.import new file mode 100644 index 0000000..d0e1204 --- /dev/null +++ b/ressources/sounds/AdBlockNot.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://cm4byed2qt10u" +path="res://.godot/imported/AdBlockNot.wav-37319fd22e4add0871f90bbb3587fdd3.sample" + +[deps] + +source_file="res://ressources/sounds/AdBlockNot.wav" +dest_files=["res://.godot/imported/AdBlockNot.wav-37319fd22e4add0871f90bbb3587fdd3.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=2 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/scenes/game/ads/Ads_music.tscn b/scenes/game/ads/Ads_music.tscn index cad797e..4162597 100644 --- a/scenes/game/ads/Ads_music.tscn +++ b/scenes/game/ads/Ads_music.tscn @@ -31,4 +31,4 @@ flat = true stream = ExtResource("5_gf3d2") bus = &"SFX" -[connection signal="pressed" from="MusicButton/Button" to="." method="_on_button_pressed"] +[connection signal="pressed" from="MusicButton/Button" to="." method="_on_button2_pressed"] diff --git a/scenes/game/screen.tscn b/scenes/game/screen.tscn index b3e2157..c674061 100644 --- a/scenes/game/screen.tscn +++ b/scenes/game/screen.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=3 uid="uid://ur6erv76d2of"] +[gd_scene load_steps=15 format=3 uid="uid://ur6erv76d2of"] [ext_resource type="FontFile" uid="uid://dwgslonlru0ck" path="res://ressources/Battlenet.ttf" id="1_7ecbr"] [ext_resource type="Script" path="res://scripts/game.gd" id="1_orxmr"] @@ -7,6 +7,8 @@ [ext_resource type="Texture2D" uid="uid://c1s8gaui8k13h" path="res://models/RetroWindowsGUI/Flag.png" id="4_medxy"] [ext_resource type="Shader" path="res://shaders/oldscreen.gdshader" id="6_7ta02"] [ext_resource type="PackedScene" uid="uid://b4ujwtugvmurm" path="res://scenes/game/windows/Video_page.tscn" id="7_3mlyk"] +[ext_resource type="PackedScene" uid="uid://d0o3thrvt3ecx" path="res://scenes/menu/rules.tscn" id="8_fvukt"] +[ext_resource type="AudioStream" uid="uid://cm4byed2qt10u" path="res://ressources/sounds/AdBlockNot.wav" id="9_j4hp8"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_se4f0"] bg_color = Color(0.764706, 0.764706, 0.764706, 1) @@ -110,3 +112,13 @@ offset_left = 96.0 offset_top = 89.0 offset_right = -450.0 offset_bottom = -104.0 + +[node name="Rules" parent="." instance=ExtResource("8_fvukt")] +visible = false +z_index = 4096 + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("9_j4hp8") +volume_db = -14.102 +autoplay = true +bus = &"Music" diff --git a/scenes/game/victoire.tscn b/scenes/game/victoire.tscn new file mode 100644 index 0000000..deb10ae --- /dev/null +++ b/scenes/game/victoire.tscn @@ -0,0 +1,3 @@ +[gd_scene format=3 uid="uid://b6d3echpt32xs"] + +[node name="Victoire" type="Node2D"] diff --git a/scenes/menu/menu.gd b/scenes/menu/menu.gd index 8923c95..7b7c88e 100644 --- a/scenes/menu/menu.gd +++ b/scenes/menu/menu.gd @@ -5,7 +5,6 @@ extends Node2D func _ready(): $Menu/Options/Rules.set_visible(false) Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) - pass # Replace with function body. # Called every frame. 'delta' is the elapsed time since the previous frame. @@ -21,13 +20,10 @@ func _on_normal_start_pressed(): pass # Replace with function body. func _on_infinite_start_pressed(): - #get_tree().change_scene_to_file("") - pass # Replace with function body. + get_tree().change_scene_to_file("res://scenes/game/screen.tscn") func _on_options_pressed(): $Menu/Options/Rules.set_visible(true) - pass # Replace with function body. func _on_close_pressed(): $Menu/Options/Rules.set_visible(false) - pass # Replace with function body. diff --git a/scenes/menu/menu.tscn b/scenes/menu/menu.tscn index e479895..8d91c93 100644 --- a/scenes/menu/menu.tscn +++ b/scenes/menu/menu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://do6hgdpuwfsmf"] +[gd_scene load_steps=17 format=3 uid="uid://do6hgdpuwfsmf"] [ext_resource type="PackedScene" uid="uid://cgdlh6iv2j7we" path="res://scenes/menu/image_menu.tscn" id="1_f4wvw"] [ext_resource type="Script" path="res://scenes/menu/menu.gd" id="1_y4d58"] @@ -11,6 +11,7 @@ [ext_resource type="Texture2D" uid="uid://c012k8qiyjn4a" path="res://models/RetroWindowsGUI/RetroWindowsGUI/Windows_Button.png" id="8_igvbm"] [ext_resource type="Texture2D" uid="uid://rryuulwvlsqi" path="res://models/RetroWindowsGUI/RetroWindowsGUI/Windows_Button_Inactive.png" id="9_npqtf"] [ext_resource type="Texture2D" uid="uid://ca0n6csxw7yd7" path="res://models/RetroWindowsGUI/RetroWindowsGUI/Windows_Button_Pressed.png" id="10_vrql1"] +[ext_resource type="AudioStream" uid="uid://cm4byed2qt10u" path="res://ressources/sounds/AdBlockNot.wav" id="12_2l6cy"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mulaw"] texture = ExtResource("8_igvbm") @@ -228,6 +229,12 @@ text = "X" icon_alignment = 1 expand_icon = true +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("12_2l6cy") +volume_db = -14.102 +autoplay = true +bus = &"Music" + [connection signal="pressed" from="Power off" to="." method="_on_power_off_pressed"] [connection signal="pressed" from="Menu/NormalStart" to="." method="_on_normal_start_pressed"] [connection signal="pressed" from="Menu/NormalStart/ButtonImageNormal" to="." method="_on_normal_start_pressed"] diff --git a/scripts/ads/ads_music.gd b/scripts/ads/ads_music.gd index 37dde44..76ba2a0 100644 --- a/scripts/ads/ads_music.gd +++ b/scripts/ads/ads_music.gd @@ -12,3 +12,7 @@ func exit_condition(): func _on_button_pressed(): condition = true + + +func _on_button2_pressed(): + condition = true diff --git a/scripts/game.gd b/scripts/game.gd index 8cffcc5..6cf358a 100644 --- a/scripts/game.gd +++ b/scripts/game.gd @@ -50,6 +50,10 @@ func load_scene(): for scene in _ads_scene: ads_scene.push_back(load(scene)) +func _input(event): + if event.is_action_pressed("ui_cancel"): + pass # todo one day ahah ^^ + # $Rules.set_visible(true) func _ready(): load_scene() @@ -65,5 +69,6 @@ func win(): # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(_delta): if win(): - pass - print("mettre écran victoire") + for n in 15: + new_ads() + # get_tree().change_scene_to_file("res://scenes/game/victoire.tscn")