diff --git a/Font/COMIC.TTF b/Font/COMIC.TTF new file mode 100644 index 0000000..2d8e9ca Binary files /dev/null and b/Font/COMIC.TTF differ diff --git a/Font/COMIC.tres b/Font/COMIC.tres new file mode 100644 index 0000000..1585887 --- /dev/null +++ b/Font/COMIC.tres @@ -0,0 +1,7 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[ext_resource path="res://Font/COMIC.TTF" type="DynamicFontData" id=1] + +[resource] +size = 37 +font_data = ExtResource( 1 ) diff --git a/Font/COMICBD.TTF b/Font/COMICBD.TTF new file mode 100644 index 0000000..59f77d5 Binary files /dev/null and b/Font/COMICBD.TTF differ diff --git a/Font/COMICI.TTF b/Font/COMICI.TTF new file mode 100644 index 0000000..49a4069 Binary files /dev/null and b/Font/COMICI.TTF differ diff --git a/Font/COMICZ.TTF b/Font/COMICZ.TTF new file mode 100644 index 0000000..f451961 Binary files /dev/null and b/Font/COMICZ.TTF differ diff --git a/Scene/EndGameWindow.tscn b/Scene/EndGameWindow.tscn new file mode 100644 index 0000000..2e2a771 --- /dev/null +++ b/Scene/EndGameWindow.tscn @@ -0,0 +1,102 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://Scene/Pause.gd" type="Script" id=1] +[ext_resource path="res://Font/COMIC.tres" type="DynamicFont" id=2] + +[node name="CanvasLayer" type="CanvasLayer"] +layer = 100 + +[node name="Window" type="Control" parent="."] +pause_mode = 2 +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Background" type="ColorRect" parent="Window"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 1.22778 +margin_top = -1.22775 +margin_right = 1.22778 +margin_bottom = -1.22778 +color = Color( 0, 0, 0, 0.309804 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ColorRect" type="ColorRect" parent="Window"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -267.0 +margin_top = -254.0 +margin_right = 256.0 +margin_bottom = 82.0 +color = Color( 0, 0, 0, 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Title" type="Label" parent="Window/ColorRect"] +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -60.5 +margin_top = 28.0 +margin_right = 83.5 +margin_bottom = 80.0 +custom_fonts/font = ExtResource( 2 ) +text = "Winner:" +align = 1 +valign = 1 +autowrap = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="WinnerName" type="Label" parent="Window/ColorRect"] +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -53.5 +margin_top = 130.0 +margin_right = 70.5 +margin_bottom = 182.0 +custom_fonts/font = ExtResource( 2 ) +text = "Player1" +align = 1 +valign = 1 +autowrap = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="HBoxContainer" parent="Window/ColorRect"] +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_top = -81.0 +margin_bottom = -6.0 +custom_constants/separation = 25 + +[node name="RestartButton" type="Button" parent="Window/ColorRect/VBoxContainer"] +margin_right = 249.0 +margin_bottom = 75.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_fonts/font = ExtResource( 2 ) +text = "Restart" + +[node name="QuitButton" type="Button" parent="Window/ColorRect/VBoxContainer"] +margin_left = 274.0 +margin_right = 523.0 +margin_bottom = 75.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_fonts/font = ExtResource( 2 ) +text = "Quit" +[connection signal="pressed" from="Window/ColorRect/VBoxContainer/RestartButton" to="Window" method="_on_RestartButton_pressed"] +[connection signal="pressed" from="Window/ColorRect/VBoxContainer/QuitButton" to="Window" method="_on_QuitButton_pressed"] diff --git a/Scene/GameManager.tscn b/Scene/GameManager.tscn new file mode 100644 index 0000000..633b068 --- /dev/null +++ b/Scene/GameManager.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://Scripts/GameManager.gd" type="Script" id=1] + +[node name="GameManager" type="Node2D"] +script = ExtResource( 1 ) diff --git a/Scene/Pause.gd b/Scene/Pause.gd new file mode 100644 index 0000000..f3269a7 --- /dev/null +++ b/Scene/Pause.gd @@ -0,0 +1,14 @@ +extends Control + +func show(): + get_tree().paused = true + self.visible = true + + +func _on_RestartButton_pressed(): + get_tree().paused = false + get_tree().reload_current_scene() + + +func _on_QuitButton_pressed(): + get_tree().quit() diff --git a/Scene/TestScene.tscn b/Scene/TestScene.tscn index 0053a74..80fd880 100644 --- a/Scene/TestScene.tscn +++ b/Scene/TestScene.tscn @@ -1,8 +1,10 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://Scene/Player.tscn" type="PackedScene" id=1] [ext_resource path="res://Assets/Placeholder.png" type="Texture" id=2] [ext_resource path="res://Scene/Clopinette.tscn" type="PackedScene" id=3] +[ext_resource path="res://Scene/EndGameWindow.tscn" type="PackedScene" id=4] +[ext_resource path="res://Scene/GameManager.tscn" type="PackedScene" id=5] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 15.6178, 15.7669 ) @@ -27,8 +29,10 @@ shape = SubResource( 1 ) [node name="Player2" parent="." instance=ExtResource( 1 )] position = Vector2( 221.278, 126.45 ) -[node name="Clopinette" parent="." instance=ExtResource( 3 )] -position = Vector2( 96.6926, 271.557 ) +[node name="Clopinette" parent="." groups=[ +"bucket", +] instance=ExtResource( 3 )] +position = Vector2( 324.755, 84.649 ) scriptName = "res://Scripts/PaintEffects/Invisibility.gd" [node name="Clopinette2" parent="." instance=ExtResource( 3 )] @@ -82,3 +86,12 @@ text = "Confusion" __meta__ = { "_edit_use_anchors_": false } + +[node name="CanvasLayer" parent="." instance=ExtResource( 4 )] + +[node name="GameManager" parent="." instance=ExtResource( 5 )] + +[node name="SpawnPoint" type="Node2D" parent="." groups=[ +"spawn_point", +]] +position = Vector2( 476.901, 71.2501 ) diff --git a/Scene/TitleScreen.gd b/Scene/TitleScreen.gd index a0f018b..f29b7de 100644 --- a/Scene/TitleScreen.gd +++ b/Scene/TitleScreen.gd @@ -1,15 +1,19 @@ extends Node2D -onready var startGameButton = $Sprite/MarginContainer/StartGameButton +onready var startGameButton = $Sprite/MarginContainer/HBoxContainer/StartGameButton +onready var quitGameButton = $Sprite/MarginContainer/HBoxContainer/QuitGameButton func _ready(): startGameButton.grab_focus() - func _process(delta): if startGameButton.is_hovered(): startGameButton.grab_focus() - + elif quitGameButton.is_hovered(): + quitGameButton.grab_focus() func _on_StartGameButton_pressed(): get_tree().change_scene("res://Scene/TestScene.tscn") + +func _on_QuitGame_pressed(): + get_tree().quit() diff --git a/Scene/TitleScreen.tscn b/Scene/TitleScreen.tscn index b6e50de..055cfc7 100644 --- a/Scene/TitleScreen.tscn +++ b/Scene/TitleScreen.tscn @@ -23,12 +23,26 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="StartGameButton" type="TextureButton" parent="Sprite/MarginContainer"] -margin_left = 756.0 +[node name="HBoxContainer" type="HBoxContainer" parent="Sprite/MarginContainer"] +margin_left = 674.0 margin_top = 771.0 -margin_right = 820.0 +margin_right = 902.0 margin_bottom = 835.0 size_flags_horizontal = 4 +size_flags_vertical = 12 +custom_constants/separation = 100 + +[node name="StartGameButton" type="TextureButton" parent="Sprite/MarginContainer/HBoxContainer"] +margin_right = 64.0 +margin_bottom = 64.0 +size_flags_horizontal = 4 size_flags_vertical = 8 texture_normal = ExtResource( 3 ) -[connection signal="pressed" from="Sprite/MarginContainer/StartGameButton" to="." method="_on_StartGameButton_pressed"] + +[node name="QuitGameButton" type="TextureButton" parent="Sprite/MarginContainer/HBoxContainer"] +margin_left = 164.0 +margin_right = 228.0 +margin_bottom = 64.0 +texture_normal = ExtResource( 3 ) +[connection signal="pressed" from="Sprite/MarginContainer/HBoxContainer/StartGameButton" to="." method="_on_StartGameButton_pressed"] +[connection signal="pressed" from="Sprite/MarginContainer/HBoxContainer/QuitGameButton" to="." method="_on_QuitGame_pressed"] diff --git a/Scripts/GameManager.gd b/Scripts/GameManager.gd index 024f168..27c803b 100644 --- a/Scripts/GameManager.gd +++ b/Scripts/GameManager.gd @@ -16,6 +16,7 @@ func spawnBucket(): func _process(delta): if get_tree().get_nodes_in_group("bucket").empty(): spawnBucket() + endGame() func endGame(): - pass + get_node("/root/World/CanvasLayer/Window").show() diff --git a/project.godot b/project.godot index aac06aa..dad2f52 100644 --- a/project.godot +++ b/project.godot @@ -109,6 +109,11 @@ ui_down2={ , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":1,"axis":1,"axis_value":1.0,"script":null) ] } +pause={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) + ] +} [rendering]