diff --git a/Assets/dossier/2.png.import b/Assets/dossier/2.png.import old mode 100644 new mode 100755 diff --git a/Assets/icons/jaquette.ico b/Assets/icons/jaquette.ico new file mode 100755 index 0000000..0af7381 Binary files /dev/null and b/Assets/icons/jaquette.ico differ diff --git a/Assets/icons/jaquette.png b/Assets/icons/jaquette.png new file mode 100755 index 0000000..10ec77d --- /dev/null +++ b/Assets/icons/jaquette.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2367b191a79238a9ca97f3b2236702b1d68227513cfc767a87504f1e4efa5ecd +size 6163699 diff --git a/Assets/icons/jaquette.png.import b/Assets/icons/jaquette.png.import new file mode 100755 index 0000000..3948aee --- /dev/null +++ b/Assets/icons/jaquette.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/jaquette.png-158cb741fd8d264739826f4af6402863.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/icons/jaquette.png" +dest_files=[ "res://.import/jaquette.png-158cb741fd8d264739826f4af6402863.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/windows/0.png.import b/Assets/windows/0.png.import old mode 100644 new mode 100755 diff --git a/Assets/windows/1.png.import b/Assets/windows/1.png.import old mode 100644 new mode 100755 diff --git a/Assets/windows/2.png.import b/Assets/windows/2.png.import old mode 100644 new mode 100755 diff --git a/Assets/windows/3.png.import b/Assets/windows/3.png.import old mode 100644 new mode 100755 diff --git a/Assets/windows/background.png b/Assets/windows/background.png new file mode 100755 index 0000000..dbe3b33 --- /dev/null +++ b/Assets/windows/background.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89b3b8a9ee05eaa35cbac933993b585fce3712fdadc517cb4f13f816d5fd45be +size 1603876 diff --git a/Assets/windows/background.png.import b/Assets/windows/background.png.import new file mode 100755 index 0000000..f511bae --- /dev/null +++ b/Assets/windows/background.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/background.png-fba0a085cd5fd6ebd4f1fbd967955538.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/windows/background.png" +dest_files=[ "res://.import/background.png-fba0a085cd5fd6ebd4f1fbd967955538.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/windows/terminal.png.import b/Assets/windows/terminal.png.import old mode 100644 new mode 100755 diff --git a/Elements/Scripts/WindowHeader.gd b/Elements/Scripts/WindowHeader.gd index e85ea35..ce7b14a 100755 --- a/Elements/Scripts/WindowHeader.gd +++ b/Elements/Scripts/WindowHeader.gd @@ -26,10 +26,8 @@ func _on_Area2D_input_event(_viewport: Node, event: InputEvent, _shape_idx: int) event = event as InputEventMouseButton if event.pressed and event.button_index == BUTTON_LEFT: drag_change_state() - #print("here haha") elif event.button_index == BUTTON_LEFT and !event.pressed: drag_change_state() - #print("here huhu") func _on_Area2D2_input_event(_viewport: Node, event: InputEvent, _shape_idx: int) -> void: diff --git a/Scenes/Help.gd b/Scenes/Help.gd new file mode 100755 index 0000000..ee4f241 --- /dev/null +++ b/Scenes/Help.gd @@ -0,0 +1,7 @@ +extends Button + +onready var window = $".." + + +func _on_Back_button_pressed() -> void: + window.visible = false diff --git a/Scenes/Scripts/Button_Node2D.gd b/Scenes/Scripts/Button_Node2D.gd index e0c8b64..1397a39 100755 --- a/Scenes/Scripts/Button_Node2D.gd +++ b/Scenes/Scripts/Button_Node2D.gd @@ -4,22 +4,21 @@ onready var villain = $"../../../Villain/AnimatedSprite" onready var villain_animations = $"../../../Villain" export(bool) var etat = false -var remplissage = 0 const texture_pressed = preload("res://Assets/tres_button/hover-pressed.png") const texture_released = preload("res://Assets/tres_button/normal.png") +var timer = 0 + # Called every frame. '_delta' is the elapsed time since the previous frame. -func _process(_delta) -> void: +func _process(delta) -> void: if etat: + timer += delta if villain.animation == villain_animations.animations[-1]: assert(get_tree().change_scene("res://Scenes/gameover.tscn") == OK) - if remplissage == 60 * 10: # fermer le dossier et enlever l'icone + if timer >= 7: # fermer le dossier et enlever l'icone etat = false self.get_parent().get_parent().visible = false - else: - remplissage += 1 - print(remplissage) func _on_Button_pressed() -> void: diff --git a/Scenes/Scripts/Desktop.gd b/Scenes/Scripts/Desktop.gd index 3eecdae..25b6c02 100755 --- a/Scenes/Scripts/Desktop.gd +++ b/Scenes/Scripts/Desktop.gd @@ -11,18 +11,17 @@ onready var terminal = $"Terminal" var rng = RandomNumberGenerator.new() const texture_file = preload("res://Assets/dossier/1.png") -const texture_terminal = preload("res://Assets/dossier/2.png") #à modifier +const texture_terminal = preload("res://Assets/dossier/2.png") #à modifier # Called when the node enters the scene tree for the first time. func _ready() -> void: - var icon = terminal.get_node("Sprite") var window = terminal.get_node("Screen") var button_window = window.get_node("Button2") var name_term = terminal.get_node("Label") var scale_icon = 0.35 - + rng.randomize() var nbDossier = rng.randi_range(4, 10) for i in range(nbDossier): @@ -46,15 +45,17 @@ func _ready() -> void: # Change button visibility button_window.visible = false - var posY = i%4 - var posX = i/4 - if(posX == 0) : posY +=1 + var posY = i % 4 + var posX = i / 4 + if posX == 0: + posY += 1 button_window.focus_mode = Button.FOCUS_NONE - dossier.position = Vector2(dossier.position.x + (150 * posX), dossier.position.y + 150 * (posY)) + dossier.position = Vector2( + dossier.position.x + (150 * posX), dossier.position.y + 150 * (posY) + ) dossier.set_z_index(dossier.get_z_index() + 10 * (i + 1)) add_child(dossier) - - + icon = terminal.get_node("Sprite") window = terminal.get_node("Screen") name_term.text = "Terminal" @@ -65,8 +66,9 @@ func _ready() -> void: window.get_node("Window").visible = false window.get_node("Window2").visible = false window.get_node("Window3").visible = true - # Change button visibility + # Change button visibility button_window.visible = false + button_window.focus_mode = Button.FOCUS_NONE # Called every frame. 'delta' is the elapsed time since the previous frame. diff --git a/Scenes/Scripts/Screen_Menu.gd b/Scenes/Scripts/Screen_Menu.gd index 7858bf4..29d87a2 100755 --- a/Scenes/Scripts/Screen_Menu.gd +++ b/Scenes/Scripts/Screen_Menu.gd @@ -1,5 +1,6 @@ extends Control onready var hover_sound = $"Hover" +onready var help = $"../Help" func _on_PlayButton_pressed() -> void: @@ -7,7 +8,7 @@ func _on_PlayButton_pressed() -> void: func _on_Help_Button_pressed() -> void: - print("help me") + help.visible = true func _on_Quit_Button_pressed() -> void: diff --git a/Scenes/help.tscn b/Scenes/help.tscn new file mode 100755 index 0000000..a8bbe37 --- /dev/null +++ b/Scenes/help.tscn @@ -0,0 +1,70 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://Assets/windows/background.png" type="Texture" id=1] +[ext_resource path="res://Assets/skin_assets/dir_font.tres" type="DynamicFont" id=2] +[ext_resource path="res://Assets/skin_assets/menu_font.tres" type="DynamicFont" id=3] +[ext_resource path="res://Assets/tres_button/pressed.tres" type="StyleBox" id=4] +[ext_resource path="res://Assets/tres_button/hover.tres" type="StyleBox" id=5] +[ext_resource path="res://Assets/tres_button/normal.tres" type="StyleBox" id=6] +[ext_resource path="res://Scenes/Help.gd" type="Script" id=7] + +[node name="HELP" type="Node2D"] + +[node name="Sprite" type="Sprite" parent="."] +position = Vector2( 512, 360 ) +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 1 ) + +[node name="Label" type="Label" parent="."] +margin_left = 1.0 +margin_top = 8.0 +margin_right = 1025.0 +margin_bottom = 726.0 +custom_fonts/font = ExtResource( 2 ) +text = "[ Aim of the game ] +If you have made it this far, you've been selected +for an important mission: + Get rid of our greatest enemy, Macreye. +He is an extremely powerful individual who has been forcing +his way of thinking for decades. +He keeps us under control with his huge hands and +his almost omnipresent eye. +Recently, one of our spies managed to connect to his system +but did not manage to destroy it. +Your task is to infiltrate the system and destroy all the files on Macreye's system +without Macreye's system without his knowledge. + +[How to Play ] +There are 3 types of elements to click on: +- Folder + When you click on it, a button appears. + This button allows you to uninstall the contents of the folder + This takes time, sometimes you have to stop the execution + to avoid being noticed. + Warning: if you close the window, the download will still be in progress. +- Classic file + Works in the same way as the folder. +- Terminal icon + This icon works the same way as the others elements. + +[Note] +It is possible to launch several files at the same time. + +Good luck soldier!" +align = 1 + +[node name="Back_button" type="Button" parent="."] +margin_left = 445.0 +margin_top = 679.0 +margin_right = 581.0 +margin_bottom = 716.0 +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.941176, 0.690196, 0.403922, 1 ) +custom_fonts/font = ExtResource( 3 ) +custom_styles/hover = ExtResource( 5 ) +custom_styles/pressed = ExtResource( 4 ) +custom_styles/normal = ExtResource( 6 ) +text = "RETOUR" +script = ExtResource( 7 ) + +[connection signal="pressed" from="Back_button" to="Back_button" method="_on_Back_button_pressed"] diff --git a/Scenes/menu.tscn b/Scenes/menu.tscn index 780d90b..f45177e 100755 --- a/Scenes/menu.tscn +++ b/Scenes/menu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://Scenes/Scripts/Screen_Menu.gd" type="Script" id=1] [ext_resource path="res://Assets/skin_assets/menu_font.tres" type="DynamicFont" id=2] @@ -8,6 +8,7 @@ [ext_resource path="res://Assets/windows/window.png" type="Texture" id=6] [ext_resource path="res://Musics/wav/menu.wav" type="AudioStream" id=7] [ext_resource path="res://Musics/sound effect/hower.wav" type="AudioStream" id=8] +[ext_resource path="res://Scenes/help.tscn" type="PackedScene" id=9] [node name="Node2D" type="Node2D"] @@ -74,6 +75,9 @@ stream = ExtResource( 7 ) volume_db = 8.0 autoplay = true +[node name="Help" parent="." instance=ExtResource( 9 )] +visible = false + [connection signal="mouse_entered" from="VBoxContainer/PlayButton" to="VBoxContainer" method="_on_PlayButton_mouse_entered"] [connection signal="pressed" from="VBoxContainer/PlayButton" to="VBoxContainer" method="_on_PlayButton_pressed"] [connection signal="mouse_entered" from="VBoxContainer/Help_Button" to="VBoxContainer" method="_on_Help_Button_mouse_entered"] diff --git a/project.godot b/project.godot index fefa692..0571d34 100755 --- a/project.godot +++ b/project.godot @@ -12,7 +12,8 @@ config_version=4 config/name="Gja" run/main_scene="res://Scenes/Menu.tscn" -config/icon="res://icon.png" +config/icon="res://Assets/icons/jaquette.png" +config/windows_native_icon="res://Assets/icons/jaquette.ico" [display]