diff --git a/.gitignore b/.gitignore index db739d3..ac4b47e 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,7 @@ $RECYCLE.BIN/ *.lnk # End of https://www.toptal.com/developers/gitignore/api/godot,linux,windows + + +# Ignore files releases +releases diff --git a/assets/levels/warcraft.jpg b/assets/levels/warcraft.jpg new file mode 100644 index 0000000..0dee25b Binary files /dev/null and b/assets/levels/warcraft.jpg differ diff --git a/assets/levels/warcraft.jpg.import b/assets/levels/warcraft.jpg.import new file mode 100644 index 0000000..b347649 --- /dev/null +++ b/assets/levels/warcraft.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/warcraft.jpg-e4725d0d4db6fd36f05286ac31e934ad.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/levels/warcraft.jpg" +dest_files=[ "res://.import/warcraft.jpg-e4725d0d4db6fd36f05286ac31e934ad.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/project.godot b/project.godot index 14dcb45..b95e738 100644 --- a/project.godot +++ b/project.godot @@ -14,6 +14,11 @@ config/name="Athena-Hidden-Object" run/main_scene="res://scenes/main.tscn" config/icon="res://icon.png" +[display] + +window/size/borderless=true +window/stretch/mode="2d" + [physics] common/enable_pause_aware_picking=true diff --git a/releases/.keep b/releases/.keep new file mode 100644 index 0000000..e69de29 diff --git a/scenes/UI/About.gd b/scenes/UI/About.gd deleted file mode 100644 index 7340780..0000000 --- a/scenes/UI/About.gd +++ /dev/null @@ -1,9 +0,0 @@ -extends Node - - -# Called when the node enters the scene tree for the first time. -func _ready(): - pass # Replace with function body. - -func _on_Return_pressed(): - get_tree().change_scene("res://scenes/main.tscn") diff --git a/scenes/UI/About.tscn b/scenes/UI/About.tscn index 6ced9c2..3eab727 100644 --- a/scenes/UI/About.tscn +++ b/scenes/UI/About.tscn @@ -1,14 +1,24 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://scenes/UI/About.gd" type="Script" id=1] +[sub_resource type="GDScript" id=1] +script/source = "extends Node + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +func _on_Return_pressed(): + get_tree().change_scene(\"res://scenes/main.tscn\") +" [node name="About" type="Node"] -script = ExtResource( 1 ) +script = SubResource( 1 ) [node name="GRem" type="Label" parent="."] -margin_left = 150.0 +margin_left = 350.0 margin_top = 150.0 -margin_right = 416.0 +margin_right = 616.0 margin_bottom = 181.0 text = "Lead Develop : GRem -- VAILLANT Jérémy " @@ -17,21 +27,11 @@ __meta__ = { } [node name="Stilobique" type="Label" parent="."] -margin_left = 300.0 +margin_left = 500.0 margin_top = 300.0 -margin_right = 583.0 +margin_right = 783.0 margin_bottom = 331.0 text = "Lead Artist : Stilobique -- VAILLANT Aurelien" __meta__ = { "_edit_use_anchors_": false } - -[node name="Return" type="LinkButton" parent="."] -margin_right = 40.0 -margin_bottom = 14.0 -text = "back" -__meta__ = { -"_edit_use_anchors_": false -} - -[connection signal="pressed" from="Return" to="." method="_on_Return_pressed"] diff --git a/scenes/UI/ChooseScene.gd b/scenes/UI/ChooseScene.gd index aa5922a..76ab863 100644 --- a/scenes/UI/ChooseScene.gd +++ b/scenes/UI/ChooseScene.gd @@ -1,7 +1,4 @@ extends Control -func _on_Return_pressed(): - get_tree().change_scene("res://scenes/main.tscn") - func _on_WarCraft_pressed(): get_tree().change_scene("res://scenes/levels/WarCraft.tscn") diff --git a/scenes/UI/ChooseScene.tscn b/scenes/UI/ChooseScene.tscn index c833225..9df5920 100644 --- a/scenes/UI/ChooseScene.tscn +++ b/scenes/UI/ChooseScene.tscn @@ -1,32 +1,30 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://scenes/UI/ChooseScene.gd" type="Script" id=1] +[ext_resource path="res://assets/levels/warcraft.jpg" type="Texture" id=2] [node name="ChooseScene" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 +margin_left = 200.0 script = ExtResource( 1 ) __meta__ = { "_edit_use_anchors_": false } [node name="GridContainer" type="GridContainer" parent="."] -margin_right = 1024.0 -margin_bottom = 600.0 +margin_left = 25.0 +margin_top = 26.2599 +margin_right = 824.0 +margin_bottom = 601.26 __meta__ = { "_edit_use_anchors_": false } -[node name="Return" type="LinkButton" parent="GridContainer"] -margin_right = 54.0 -margin_bottom = 14.0 -text = "back" +[node name="WarCraft" type="TextureButton" parent="GridContainer"] +margin_right = 150.0 +margin_bottom = 150.0 +mouse_default_cursor_shape = 2 +texture_normal = ExtResource( 2 ) -[node name="WarCraft" type="LinkButton" parent="GridContainer"] -margin_top = 18.0 -margin_right = 54.0 -margin_bottom = 32.0 -text = "WarCraft" - -[connection signal="pressed" from="GridContainer/Return" to="." method="_on_Return_pressed"] [connection signal="pressed" from="GridContainer/WarCraft" to="." method="_on_WarCraft_pressed"] diff --git a/scenes/main.gd b/scenes/main.gd index 1d9700f..62e3dac 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -1,13 +1,28 @@ extends Node +export (PackedScene) var about = load("res://scenes/UI/About.tscn") +export (PackedScene) var scenes = load("res://scenes/UI/ChooseScene.tscn") + +var scene + # Quit the game func _on_Quit_pressed(): get_tree().quit(0) # Load scene about func _on_About_pressed(): - get_tree().change_scene("res://scenes/UI/About.tscn") + _prepare_change_scene() + scene = about.instance() + add_child(scene) # Load scene for select game func _on_New_pressed(): - get_tree().change_scene("res://scenes/UI/ChooseScene.tscn") + _prepare_change_scene() + scene = scenes.instance() + add_child(scene) + +## PRIVATE +func _prepare_change_scene(): + if (scene != null): + remove_child(scene) + scene.call_deferred("free") diff --git a/scenes/main.tscn b/scenes/main.tscn index 5d5cc56..628b30e 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://scenes/main.gd" type="Script" id=1] +[ext_resource path="res://icon.png" type="Texture" id=2] [sub_resource type="GDScript" id=1] script/source = "extends LinkButton @@ -11,6 +12,14 @@ script/source = "extends LinkButton [node name="Main" type="Node"] script = ExtResource( 1 ) +[node name="ColorRect" type="ColorRect" parent="."] +margin_right = 1024.0 +margin_bottom = 600.0 +color = Color( 0.156863, 0.00392157, 0.0156863, 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + [node name="Grid" type="GridContainer" parent="."] margin_left = -1.33484 margin_right = 1022.67 @@ -19,39 +28,84 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Title" type="Label" parent="Grid"] -margin_right = 151.0 -margin_bottom = 14.0 -text = "Athena - Hidden Object" +[node name="Menu" type="Panel" parent="Grid"] + +[node name="Banner" type="Panel" parent="Grid/Menu"] +margin_right = 150.0 +margin_bottom = 150.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ColorRect" type="ColorRect" parent="Grid/Menu/Banner"] +margin_right = 150.0 +margin_bottom = 150.0 +color = Color( 0.992157, 0.705882, 0, 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Title" type="Label" parent="Grid/Menu/Banner/ColorRect"] +margin_right = 150.0 +margin_bottom = 150.0 +text = "Loki +" align = 1 -valign = 1 +valign = 2 +__meta__ = { +"_edit_use_anchors_": false +} -[node name="New" type="LinkButton" parent="Grid"] -margin_top = 18.0 -margin_right = 151.0 -margin_bottom = 32.0 +[node name="TextureRect" type="TextureRect" parent="Grid/Menu/Banner/ColorRect/Title"] +margin_left = 48.0 +margin_right = 176.0 +margin_bottom = 128.0 +rect_scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Action" type="Panel" parent="Grid/Menu"] +margin_top = 150.0 +margin_right = 150.0 +margin_bottom = 600.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="New" type="LinkButton" parent="Grid/Menu/Action"] +margin_top = 30.0 +margin_right = 150.0 +margin_bottom = 44.0 text = "Nouveau" +__meta__ = { +"_edit_use_anchors_": false +} -[node name="Continue" type="LinkButton" parent="Grid"] -margin_top = 36.0 +[node name="Continue" type="LinkButton" parent="Grid/Menu/Action"] +margin_top = 70.0 margin_right = 151.0 -margin_bottom = 50.0 +margin_bottom = 74.0 disabled = true text = "Reprendre" -[node name="About" type="LinkButton" parent="Grid"] -margin_top = 54.0 +[node name="About" type="LinkButton" parent="Grid/Menu/Action"] +margin_top = 110.0 margin_right = 151.0 -margin_bottom = 68.0 +margin_bottom = 80.0 text = "Credit" -[node name="Quit" type="LinkButton" parent="Grid"] -margin_top = 72.0 +[node name="Quit" type="LinkButton" parent="Grid/Menu/Action"] +margin_top = 400.0 margin_right = 151.0 -margin_bottom = 86.0 +margin_bottom = 98.0 text = "Quitter" script = SubResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} -[connection signal="pressed" from="Grid/New" to="." method="_on_New_pressed"] -[connection signal="pressed" from="Grid/About" to="." method="_on_About_pressed"] -[connection signal="pressed" from="Grid/Quit" to="." method="_on_Quit_pressed"] +[connection signal="pressed" from="Grid/Menu/Action/New" to="." method="_on_New_pressed"] +[connection signal="pressed" from="Grid/Menu/Action/About" to="." method="_on_About_pressed"] +[connection signal="pressed" from="Grid/Menu/Action/Quit" to="." method="_on_Quit_pressed"]