1
Fork 0
mirror of https://github.com/Steffo99/particle-clash.git synced 2024-11-21 23:24:18 +00:00

Polishing and bugfixing

This commit is contained in:
Steffo 2022-10-02 15:32:40 +02:00
parent 63703a8b99
commit c2a692c082
Signed by: steffo
GPG key ID: 6965406171929D01
5 changed files with 82 additions and 100 deletions

View file

@ -11,6 +11,7 @@ config_version=4
[application] [application]
config/name="Particle Clash" config/name="Particle Clash"
config/description="[LD51 Compo] A match-4 game about particles about to collide."
run/main_scene="res://src/Main.tscn" run/main_scene="res://src/Main.tscn"
boot_splash/show_image=false boot_splash/show_image=false
config/icon="res://src/sprites/atom.png" config/icon="res://src/sprites/atom.png"

View file

@ -207,49 +207,7 @@ script = ExtResource( 5 )
position = Vector2( 800, 450 ) position = Vector2( 800, 450 )
[node name="Menu" parent="." instance=ExtResource( 1 )] [node name="Menu" parent="." instance=ExtResource( 1 )]
rect_min_size = Vector2( 1600, 900 )
[node name="Title" parent="Menu/VBoxContainer" index="0"]
margin_top = 78.0
margin_right = 1600.0
margin_bottom = 136.0
[node name="Title2" parent="Menu/VBoxContainer" index="1"]
margin_top = 140.0
margin_right = 1600.0
margin_bottom = 170.0
[node name="Padding" parent="Menu/VBoxContainer" index="2"]
margin_top = 174.0
margin_right = 1600.0
margin_bottom = 214.0
[node name="Colors" parent="Menu/VBoxContainer" index="3"]
margin_top = 218.0
margin_right = 1600.0
margin_bottom = 726.0
[node name="Left Player" parent="Menu/VBoxContainer/Colors" index="0"]
margin_left = 304.0
margin_right = 724.0
[node name="Vs" parent="Menu/VBoxContainer/Colors" index="1"]
margin_left = 728.0
margin_right = 872.0
[node name="Right Player" parent="Menu/VBoxContainer/Colors" index="2"]
margin_left = 876.0
margin_right = 1296.0
[node name="Padding2" parent="Menu/VBoxContainer" index="4"]
margin_top = 730.0
margin_right = 1600.0
margin_bottom = 770.0
[node name="Button" parent="Menu/VBoxContainer" index="5"]
margin_left = 720.0
margin_top = 774.0
margin_right = 880.0
margin_bottom = 822.0
[node name="Gameplay" parent="." instance=ExtResource( 2 )] [node name="Gameplay" parent="." instance=ExtResource( 2 )]
visible = false visible = false
@ -355,9 +313,9 @@ custom_colors/font_outline_modulate = Color( 0, 0, 0, 1 )
margin_top = 538.0 margin_top = 538.0
margin_bottom = 568.0 margin_bottom = 568.0
[connection signal="color_changed" from="Menu/VBoxContainer/Colors/Left Player/ColorPicker" to="." method="_on_LeftColorPicker_color_changed"] [connection signal="color_changed" from="Menu/HContainer/VContainer/Colors/Left Player/ColorPicker" to="." method="_on_LeftColorPicker_color_changed"]
[connection signal="color_changed" from="Menu/VBoxContainer/Colors/Right Player/ColorPicker" to="." method="_on_RightColorPicker_color_changed"] [connection signal="color_changed" from="Menu/HContainer/VContainer/Colors/Right Player/ColorPicker" to="." method="_on_RightColorPicker_color_changed"]
[connection signal="button_up" from="Menu/VBoxContainer/Button" to="." method="_on_Button_button_up"] [connection signal="button_up" from="Menu/HContainer/VContainer/Button" to="." method="_on_Button_button_up"]
[connection signal="timeout" from="Gameplay/Timer" to="." method="_on_PlayTimer_timeout"] [connection signal="timeout" from="Gameplay/Timer" to="." method="_on_PlayTimer_timeout"]
[connection signal="animation_finished" from="Transitions/MenuTransition/Fade" to="." method="_on_MenuFade_animation_finished"] [connection signal="animation_finished" from="Transitions/MenuTransition/Fade" to="." method="_on_MenuFade_animation_finished"]
[connection signal="animation_finished" from="Transitions/LeftTransition/Fade" to="." method="_on_SideFade_animation_finished"] [connection signal="animation_finished" from="Transitions/LeftTransition/Fade" to="." method="_on_SideFade_animation_finished"]

View file

@ -17,6 +17,9 @@ self_modulate = Color( 1, 0.701961, 0.701961, 1 )
position = Vector2( 400, 450 ) position = Vector2( 400, 450 )
player = "p1" player = "p1"
[node name="Label" parent="LeftPlayArea" index="0"]
self_modulate = Color( 1, 0.7, 0.7, 1 )
[node name="Tiles" parent="LeftPlayArea" index="1"] [node name="Tiles" parent="LeftPlayArea" index="1"]
visible = true visible = true
self_modulate = Color( 1, 0.701961, 0.701961, 1 ) self_modulate = Color( 1, 0.701961, 0.701961, 1 )
@ -26,6 +29,9 @@ self_modulate = Color( 0.701961, 0.701961, 1, 1 )
position = Vector2( 1200, 450 ) position = Vector2( 1200, 450 )
player = "p2" player = "p2"
[node name="Label" parent="RightPlayArea" index="0"]
self_modulate = Color( 0.7, 0.7, 1, 1 )
[node name="Tiles" parent="RightPlayArea" index="1"] [node name="Tiles" parent="RightPlayArea" index="1"]
visible = true visible = true
self_modulate = Color( 0.701961, 0.701961, 1, 1 ) self_modulate = Color( 0.701961, 0.701961, 1, 1 )

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=6 format=2] [gd_scene load_steps=7 format=2]
[ext_resource path="res://src/fonts/Xolonium-Bold.ttf" type="DynamicFontData" id=1] [ext_resource path="res://src/fonts/Xolonium-Bold.ttf" type="DynamicFontData" id=1]
[ext_resource path="res://src/fonts/Xolonium-Regular.ttf" type="DynamicFontData" id=2] [ext_resource path="res://src/fonts/Xolonium-Regular.ttf" type="DynamicFontData" id=2]
@ -10,6 +10,9 @@ font_data = ExtResource( 2 )
[sub_resource type="Theme" id=2] [sub_resource type="Theme" id=2]
default_font = SubResource( 1 ) default_font = SubResource( 1 )
[sub_resource type="DynamicFont" id=4]
font_data = ExtResource( 2 )
[sub_resource type="DynamicFont" id=3] [sub_resource type="DynamicFont" id=3]
size = 48 size = 48
font_data = ExtResource( 1 ) font_data = ExtResource( 1 )
@ -17,54 +20,69 @@ font_data = ExtResource( 1 )
[node name="Menu" type="Control"] [node name="Menu" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_right = 1600.0
margin_bottom = 900.0
theme = SubResource( 2 ) theme = SubResource( 2 )
[node name="VBoxContainer" type="VBoxContainer" parent="."] [node name="HContainer" type="HBoxContainer" parent="."]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
alignment = 1 alignment = 1
[node name="Title" type="Label" parent="VBoxContainer"] [node name="VContainer" type="VBoxContainer" parent="HContainer"]
margin_top = 528.0 margin_left = 304.0
margin_right = 3200.0 margin_right = 1296.0
margin_bottom = 586.0 margin_bottom = 900.0
[node name="Credits" type="Label" parent="HContainer/VContainer"]
margin_right = 992.0
margin_bottom = 20.0
custom_fonts/font = SubResource( 4 )
text = "LD51 Compo entry - @Steffo"
align = 1
[node name="Padding3" type="HBoxContainer" parent="HContainer/VContainer"]
margin_top = 24.0
margin_right = 992.0
margin_bottom = 68.0
rect_min_size = Vector2( 0, 44 )
[node name="Title" type="Label" parent="HContainer/VContainer"]
margin_top = 72.0
margin_right = 992.0
margin_bottom = 130.0
custom_fonts/font = SubResource( 3 ) custom_fonts/font = SubResource( 3 )
text = "Particle Clash" text = "Particle Clash"
align = 1 align = 1
[node name="Title2" type="Label" parent="VBoxContainer"] [node name="Action" type="Label" parent="HContainer/VContainer"]
margin_top = 590.0 margin_top = 134.0
margin_right = 3200.0 margin_right = 992.0
margin_bottom = 620.0 margin_bottom = 164.0
text = "Pick your (preferably light) colors!" text = "Pick your (preferably light) colors!"
align = 1 align = 1
[node name="Padding" type="HBoxContainer" parent="VBoxContainer"] [node name="Padding" type="HBoxContainer" parent="HContainer/VContainer"]
margin_top = 624.0 margin_top = 168.0
margin_right = 3200.0 margin_right = 992.0
margin_bottom = 664.0 margin_bottom = 208.0
rect_min_size = Vector2( 0, 40 ) rect_min_size = Vector2( 0, 40 )
[node name="Colors" type="HBoxContainer" parent="VBoxContainer"] [node name="Colors" type="HBoxContainer" parent="HContainer/VContainer"]
margin_top = 668.0 margin_top = 212.0
margin_right = 3200.0 margin_right = 992.0
margin_bottom = 1176.0 margin_bottom = 720.0
alignment = 1 alignment = 1
[node name="Left Player" type="VBoxContainer" parent="VBoxContainer/Colors"] [node name="Left Player" type="VBoxContainer" parent="HContainer/VContainer/Colors"]
margin_left = 1104.0 margin_right = 420.0
margin_right = 1524.0
margin_bottom = 508.0 margin_bottom = 508.0
alignment = 1 alignment = 1
[node name="Label" type="Label" parent="VBoxContainer/Colors/Left Player"] [node name="Label" type="Label" parent="HContainer/VContainer/Colors/Left Player"]
margin_right = 420.0 margin_right = 420.0
margin_bottom = 30.0 margin_bottom = 30.0
text = "Left Player [WASD + Space]" text = "Left Player [WASD + Space]"
[node name="ColorPicker" type="ColorPicker" parent="VBoxContainer/Colors/Left Player"] [node name="ColorPicker" type="ColorPicker" parent="HContainer/VContainer/Colors/Left Player"]
margin_top = 34.0 margin_top = 34.0
margin_right = 420.0 margin_right = 420.0
margin_bottom = 508.0 margin_bottom = 508.0
@ -74,14 +92,14 @@ hsv_mode = true
presets_enabled = false presets_enabled = false
presets_visible = false presets_visible = false
[node name="Vs" type="VBoxContainer" parent="VBoxContainer/Colors"] [node name="Vs" type="VBoxContainer" parent="HContainer/VContainer/Colors"]
margin_left = 1528.0 margin_left = 424.0
margin_right = 1672.0 margin_right = 568.0
margin_bottom = 508.0 margin_bottom = 508.0
rect_min_size = Vector2( 144, 0 ) rect_min_size = Vector2( 144, 0 )
alignment = 1 alignment = 1
[node name="Label" type="Label" parent="VBoxContainer/Colors/Vs"] [node name="Label" type="Label" parent="HContainer/VContainer/Colors/Vs"]
margin_top = 239.0 margin_top = 239.0
margin_right = 144.0 margin_right = 144.0
margin_bottom = 269.0 margin_bottom = 269.0
@ -89,19 +107,19 @@ text = "VS"
align = 1 align = 1
valign = 1 valign = 1
[node name="Right Player" type="VBoxContainer" parent="VBoxContainer/Colors"] [node name="Right Player" type="VBoxContainer" parent="HContainer/VContainer/Colors"]
margin_left = 1676.0 margin_left = 572.0
margin_right = 2096.0 margin_right = 992.0
margin_bottom = 508.0 margin_bottom = 508.0
alignment = 1 alignment = 1
[node name="Label" type="Label" parent="VBoxContainer/Colors/Right Player"] [node name="Label" type="Label" parent="HContainer/VContainer/Colors/Right Player"]
margin_right = 420.0 margin_right = 420.0
margin_bottom = 30.0 margin_bottom = 30.0
text = "[↑←↓→ + Enter] Right Player" text = "[↑←↓→ + Enter] Right Player"
align = 2 align = 2
[node name="ColorPicker" type="ColorPicker" parent="VBoxContainer/Colors/Right Player"] [node name="ColorPicker" type="ColorPicker" parent="HContainer/VContainer/Colors/Right Player"]
margin_top = 34.0 margin_top = 34.0
margin_right = 420.0 margin_right = 420.0
margin_bottom = 508.0 margin_bottom = 508.0
@ -111,17 +129,17 @@ hsv_mode = true
presets_enabled = false presets_enabled = false
presets_visible = false presets_visible = false
[node name="Padding2" type="HBoxContainer" parent="VBoxContainer"] [node name="Padding2" type="HBoxContainer" parent="HContainer/VContainer"]
margin_top = 1180.0 margin_top = 724.0
margin_right = 3200.0 margin_right = 992.0
margin_bottom = 1220.0 margin_bottom = 764.0
rect_min_size = Vector2( 0, 40 ) rect_min_size = Vector2( 0, 40 )
[node name="Button" type="Button" parent="VBoxContainer"] [node name="Button" type="Button" parent="HContainer/VContainer"]
margin_left = 1520.0 margin_left = 416.0
margin_top = 1224.0 margin_top = 768.0
margin_right = 1680.0 margin_right = 576.0
margin_bottom = 1272.0 margin_bottom = 816.0
rect_min_size = Vector2( 160, 48 ) rect_min_size = Vector2( 160, 48 )
size_flags_horizontal = 4 size_flags_horizontal = 4
text = "Start!" text = "Start!"

View file

@ -19,19 +19,18 @@ func set_cursor_pos(val):
) )
cursor_pos = val cursor_pos = val
func cursor_would_collide(top_left: Vector2): func cursor_would_collide(dest: Vector2):
var shape = $Tiles.shape var shape = $Tiles.shape
var size_x = len(shape) - 1 var size = len(shape)
var size_y = len(shape[0]) - 1
return \ return \
top_left.x < 0 || \ dest.x < 0 || \
top_left.y < 0 || \ dest.y < 0 || \
top_left.x >= size_x || \ dest.x > size - 2 || \
top_left.y >= size_y || \ dest.y > size - 2 || \
shape[top_left.x][top_left.y] == " " || \ shape[dest.y][dest.x] == " " || \
shape[top_left.x+1][top_left.y] == " " || \ shape[dest.y+1][dest.x] == " " || \
shape[top_left.x][top_left.y+1] == " " || \ shape[dest.y][dest.x+1] == " " || \
shape[top_left.x+1][top_left.y+1] == " " shape[dest.y+1][dest.x+1] == " "
func cursor_init(): func cursor_init():
var shape = $Tiles.shape var shape = $Tiles.shape