Graphical Overhaul

This commit is contained in:
Exobyt 2024-08-20 16:59:16 +02:00
parent b9eec60df7
commit 65bf9e0c86
15 changed files with 338 additions and 23 deletions

6
Theme/labelSmall.tres Normal file
View file

@ -0,0 +1,6 @@
[gd_resource type="LabelSettings" format=3 uid="uid://4dxhnwmd773s"]
[resource]
font_size = 32
outline_size = 10
outline_color = Color(0, 0, 0, 1)

BIN
assets/Examples/Expand.pxo Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://moh5papp3x0c"
path="res://.godot/imported/ExpandExample.png-e4688e4e3f66e7f36c13c14009a169fe.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Examples/ExpandExample.png"
dest_files=["res://.godot/imported/ExpandExample.png-e4688e4e3f66e7f36c13c14009a169fe.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
assets/background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cj6fsj1ac11a1"
path="res://.godot/imported/background.png-1fdba8b6a966ce2c2ffc607f7c096e95.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/background.png"
dest_files=["res://.godot/imported/background.png-1fdba8b6a966ce2c2ffc607f7c096e95.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
assets/background.pxo Normal file

Binary file not shown.

View file

@ -28,7 +28,7 @@ var lastUID = 1
var currentUID = lastUID
var time = 120
var time = 60
var lost = false
@ -42,7 +42,7 @@ func resetGame():
points = 0
lastUID = 0
currentUID = lastUID
time = 120
time = 60
lost = false
func _ready() -> void:

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=19 format=3 uid="uid://dwl4lotl1d3ij"]
[gd_scene load_steps=20 format=3 uid="uid://dwl4lotl1d3ij"]
[ext_resource type="Script" path="res://scenes/Grid/grid.gd" id="1_vie5m"]
[ext_resource type="Texture2D" uid="uid://cj6fsj1ac11a1" path="res://assets/background.png" id="2_vakrw"]
[ext_resource type="PackedScene" uid="uid://bm7rshwf6pjb" path="res://scenes/Grid/border.tscn" id="4_3j08q"]
[ext_resource type="PackedScene" uid="uid://duubii5uu3lgq" path="res://scenes/Grid/row_test.tscn" id="4_si3v6"]
[ext_resource type="PackedScene" uid="uid://dvrotjxom4u6d" path="res://scenes/Grid/bottom.tscn" id="5_14njh"]
@ -29,16 +30,18 @@ size = Vector2(640, 256)
[node name="Grid" type="Node2D"]
script = ExtResource("1_vie5m")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(7.62939e-06, 7.62939e-06)
scale = Vector2(108.422, 96.375)
[node name="MeshInstance2D" type="MeshInstance2D" parent="."]
modulate = Color(0.359096, 0.426588, 0.599397, 1)
position = Vector2(320, 640)
scale = Vector2(640, 1280)
mesh = SubResource("QuadMesh_qfjsc")
[node name="TextureRect" type="TextureRect" parent="."]
offset_right = 640.0
offset_bottom = 1280.0
texture = ExtResource("2_vakrw")
stretch_mode = 1
[node name="Blocks" type="Node2D" parent="."]
[node name="Spawnpoint" type="Marker2D" parent="."]
@ -154,7 +157,11 @@ script = ExtResource("6_mbeib")
[node name="Control" type="Control" parent="Camera2D/CanvasLayer"]
layout_mode = 3
anchors_preset = 0
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("7_38u5s")
script = ExtResource("8_4bfjb")
@ -275,6 +282,10 @@ action_mode = 0
icon = ExtResource("14_i1yud")
icon_alignment = 1
[node name="Background" type="Sprite2D" parent="."]
position = Vector2(320, 640)
scale = Vector2(10, 20)
[connection signal="timeout" from="Ticker" to="." method="_on_ticker_timeout"]
[connection signal="timeout" from="TurnTick" to="." method="_on_turn_tick_timeout"]
[connection signal="timeout" from="GameTimer" to="." method="_on_game_timer_timeout"]

View file

@ -1,21 +1,34 @@
extends Node
@onready var scenes = $scenes
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
loadGrid()
loadStartMenu()
func _physics_process(delta: float) -> void:
if get_children() != []:
if GLOBAL.lost and get_child(0).name == "Grid":
if scenes.get_children() != []:
if GLOBAL.lost and scenes.get_child(0).name == "Grid":
scoreOverview()
func loadGrid():
if $ScoreOverview != null:
$ScoreOverview.queue_free()
add_child(load("res://scenes/Grid/grid.tscn").instantiate())
$Grid.toggleButton()
if $scenes/ScoreOverview != null:
$scenes/ScoreOverview.queue_free()
if $scenes/StartMenu != null:
$scenes/StartMenu.queue_free()
scenes.add_child(load("res://scenes/Grid/grid.tscn").instantiate())
$scenes/Grid.toggleButton()
func scoreOverview():
if $Grid != null:
$Grid.queue_free()
add_child(load("res://scenes/ScoreOverview/score_overview.tscn").instantiate())
if $scenes/Grid != null:
$scenes/Grid.queue_free()
if $scenes/StartMenu != null:
$scenes/StartMenu.queue_free()
scenes.add_child(load("res://scenes/ScoreOverview/score_overview.tscn").instantiate())
func loadStartMenu():
if $scenes/ScoreOverview != null:
$scenes/ScoreOverview.queue_free()
if $scenes/Grid != null:
$scenes/Grid.queue_free()
scenes.add_child(load("res://scenes/Menu/start_menu.tscn").instantiate())

View file

@ -1,6 +1,77 @@
[gd_scene load_steps=2 format=3 uid="uid://bq5hrqgv0f6hp"]
[gd_scene load_steps=3 format=3 uid="uid://bq5hrqgv0f6hp"]
[ext_resource type="Script" path="res://scenes/Main/main.gd" id="1_dtde6"]
[ext_resource type="Texture2D" uid="uid://cbuxv7iwn0qm7" path="res://assets/Blocks/Block.png" id="2_5ae6b"]
[node name="main" type="Node"]
script = ExtResource("1_dtde6")
[node name="ColorRect" type="ColorRect" parent="."]
show_behind_parent = true
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -832.0
offset_top = -1008.0
offset_right = 674.0
offset_bottom = -1991.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(0.996259, 9.13391)
color = Color(0.000693898, 0.000693898, 0.000693898, 1)
[node name="CPUParticles2D" type="CPUParticles2D" parent="ColorRect"]
modulate = Color(1, 1, 1, 0.478431)
position = Vector2(1300.87, 37.6618)
scale = Vector2(0.501878, 0.054741)
amount = 20
lifetime = 5.0
preprocess = 5.0
speed_scale = 0.5
local_coords = true
texture = ExtResource("2_5ae6b")
emission_shape = 3
emission_rect_extents = Vector2(2000, 0)
spread = 0.0
tangential_accel_max = 100.0
damping_max = 100.0
scale_amount_max = 2.0
color = Color(1, 0, 0, 1)
[node name="CPUParticles2D2" type="CPUParticles2D" parent="ColorRect"]
modulate = Color(1, 1, 1, 0.478431)
position = Vector2(1300.87, 37.6618)
scale = Vector2(0.501878, 0.054741)
amount = 20
lifetime = 5.0
preprocess = 5.0
speed_scale = 0.5
local_coords = true
texture = ExtResource("2_5ae6b")
emission_shape = 3
emission_rect_extents = Vector2(2000, 0)
spread = 0.0
tangential_accel_max = 100.0
damping_max = 100.0
scale_amount_max = 2.0
color = Color(0, 0.0499997, 1, 1)
[node name="CPUParticles2D3" type="CPUParticles2D" parent="ColorRect"]
modulate = Color(1, 1, 1, 0.478431)
position = Vector2(1300.87, 37.6618)
scale = Vector2(0.501878, 0.054741)
amount = 20
lifetime = 5.0
preprocess = 5.0
speed_scale = 0.5
local_coords = true
texture = ExtResource("2_5ae6b")
emission_shape = 3
emission_rect_extents = Vector2(2000, 0)
spread = 0.0
tangential_accel_max = 100.0
damping_max = 100.0
scale_amount_max = 2.0
color = Color(0.966667, 1, 0, 1)
[node name="scenes" type="Node" parent="."]

15
scenes/Menu/start_menu.gd Normal file
View file

@ -0,0 +1,15 @@
extends Control
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_start_button_pressed() -> void:
get_parent().get_parent().loadGrid()

114
scenes/Menu/start_menu.tscn Normal file
View file

@ -0,0 +1,114 @@
[gd_scene load_steps=9 format=3 uid="uid://b8cyvtgn8kxnr"]
[ext_resource type="Theme" uid="uid://1nebbd65iyce" path="res://Theme/main.tres" id="1_t0oee"]
[ext_resource type="Script" path="res://scenes/Menu/start_menu.gd" id="2_1x51p"]
[ext_resource type="LabelSettings" uid="uid://cd783ubpcytc8" path="res://Theme/label.tres" id="3_wtvc4"]
[ext_resource type="Texture2D" uid="uid://cbuxv7iwn0qm7" path="res://assets/Blocks/Block.png" id="4_kxydi"]
[ext_resource type="LabelSettings" uid="uid://4dxhnwmd773s" path="res://Theme/labelSmall.tres" id="5_mn7xi"]
[ext_resource type="Texture2D" uid="uid://dni2qahrw2p0k" path="res://assets/Blocks/SpecialBlock.png" id="6_rda4c"]
[ext_resource type="Texture2D" uid="uid://moh5papp3x0c" path="res://assets/Examples/ExpandExample.png" id="7_mn4r0"]
[ext_resource type="Texture2D" uid="uid://jmobplsqdy6o" path="res://assets/Blocks/ExpandBlock.png" id="7_tut8s"]
[node name="StartMenu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_t0oee")
script = ExtResource("2_1x51p")
[node name="StartButton" type="Button" parent="."]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -156.0
offset_top = -320.0
offset_right = 4.0
offset_bottom = -224.0
grow_horizontal = 2
grow_vertical = 0
scale = Vector2(2, 2)
text = "Start"
[node name="Label" type="Label" parent="."]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -156.0
offset_top = 64.0
offset_right = 164.0
offset_bottom = 192.0
grow_horizontal = 2
text = "Texpand"
label_settings = ExtResource("3_wtvc4")
horizontal_alignment = 1
vertical_alignment = 1
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -245.0
offset_top = -90.0
offset_right = 245.0
offset_bottom = 90.0
grow_horizontal = 2
grow_vertical = 2
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
alignment = 1
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
texture = ExtResource("4_kxydi")
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
text = " Gives 1 Point "
label_settings = ExtResource("5_mn7xi")
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
alignment = 1
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/HBoxContainer2"]
layout_mode = 2
texture = ExtResource("6_rda4c")
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2"]
layout_mode = 2
text = " Gives 3 Points "
label_settings = ExtResource("5_mn7xi")
[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
alignment = 1
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/HBoxContainer4"]
layout_mode = 2
texture = ExtResource("7_tut8s")
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer4"]
layout_mode = 2
text = " Gives x2 Points"
label_settings = ExtResource("5_mn7xi")
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
alignment = 1
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/HBoxContainer3"]
layout_mode = 2
texture = ExtResource("7_mn4r0")
[connection signal="pressed" from="StartButton" to="." method="_on_start_button_pressed"]

View file

@ -15,5 +15,11 @@ func _process(delta: float) -> void:
pass
func _on_left_button_pressed() -> void:
get_parent().loadGrid()
func _on_play_again_button_pressed() -> void:
get_parent().get_parent().laodGrid()
func _on_home_pressed() -> void:
get_parent().get_parent().loadStartMenu()

View file

@ -62,11 +62,22 @@ layout_mode = 2
label_settings = ExtResource("4_dfemu")
horizontal_alignment = 1
[node name="left_Button" type="Button" parent="VBoxContainer3"]
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer3"]
layout_mode = 2
alignment = 1
[node name="playAgainButton" type="Button" parent="VBoxContainer3/HBoxContainer"]
layout_mode = 2
action_mode = 0
text = "Play Again"
icon = ExtResource("5_xkigm")
expand_icon = true
[connection signal="pressed" from="VBoxContainer3/left_Button" to="." method="_on_left_button_pressed"]
[node name="Home" type="Button" parent="VBoxContainer3/HBoxContainer"]
layout_mode = 2
action_mode = 0
text = " Home "
expand_icon = true
[connection signal="pressed" from="VBoxContainer3/HBoxContainer/playAgainButton" to="." method="_on_play_again_button_pressed"]
[connection signal="pressed" from="VBoxContainer3/HBoxContainer/Home" to="." method="_on_home_pressed"]