Bombs push other players, tweaked level
This commit is contained in:
+10
-2
@@ -60,6 +60,7 @@ script = ExtResource("4_2tdl1")
|
||||
world_path = NodePath("../Viewport/World")
|
||||
|
||||
[node name="GameStartupWidgets" type="Panel" parent="GameUI"]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -110,9 +111,10 @@ theme_override_constants/shadow_offset_x = 20
|
||||
theme_override_constants/shadow_offset_y = 20
|
||||
theme_override_constants/outline_size = 40
|
||||
theme_override_font_sizes/font_size = 160
|
||||
text = "CLASH"
|
||||
text = "DASH"
|
||||
|
||||
[node name="Label3" type="Label" parent="GameUI/GameStartupWidgets/Logo"]
|
||||
layout_mode = 0
|
||||
offset_left = -142.0
|
||||
offset_top = -107.871
|
||||
offset_right = 182.0
|
||||
@@ -126,6 +128,7 @@ theme_override_font_sizes/font_size = 160
|
||||
text = "BOOM"
|
||||
|
||||
[node name="Label4" type="Label" parent="GameUI/GameStartupWidgets/Logo"]
|
||||
layout_mode = 0
|
||||
offset_left = -219.0
|
||||
offset_top = 12.1293
|
||||
offset_right = 120.0
|
||||
@@ -139,6 +142,7 @@ theme_override_font_sizes/font_size = 160
|
||||
text = "COLOR"
|
||||
|
||||
[node name="Label5" type="Label" parent="GameUI/GameStartupWidgets/Logo"]
|
||||
layout_mode = 0
|
||||
offset_left = -34.0
|
||||
offset_top = 97.0
|
||||
offset_right = 305.0
|
||||
@@ -152,7 +156,6 @@ theme_override_font_sizes/font_size = 160
|
||||
text = "CLASH"
|
||||
|
||||
[node name="GameFinishedWidgets" type="Panel" parent="GameUI"]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -181,6 +184,11 @@ theme_override_font_sizes/font_size = 120
|
||||
text = "Game Over!"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="WinnerLabel" type="Label" parent="GameUI/GameFinishedWidgets/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Player 1 wins"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="GameUI/GameFinishedWidgets/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
+9
-1
@@ -14,6 +14,7 @@ extends Control
|
||||
|
||||
@onready var time_left_label : Label = $'GameRunningWidgets/TimeWidgets/TimeLeftLabel'
|
||||
|
||||
@onready var winner_label : Label = $'GameFinishedWidgets/VBoxContainer/WinnerLabel'
|
||||
@onready var player1_stats_points : Label = $'GameFinishedWidgets/VBoxContainer/HBoxContainer/Player1Stats/Points'
|
||||
@onready var player2_stats_points : Label = $'GameFinishedWidgets/VBoxContainer/HBoxContainer/Player2Stats/Points'
|
||||
|
||||
@@ -49,17 +50,24 @@ func _process(_delta):
|
||||
player1_score_label.text = str(world.players[0].score)
|
||||
player1_energy_progressbar.value = world.players[0].energy
|
||||
player1_stats_points.text = str(world.players[0].score)
|
||||
var winner_player : Player = world.players[0]
|
||||
|
||||
if player2_widgets.visible:
|
||||
player2_score_label.text = str(world.players[1].score)
|
||||
player2_energy_progressbar.value = world.players[1].energy
|
||||
player2_stats_points.text = str(world.players[1].score)
|
||||
if world.players[1].score > world.players[0].score:
|
||||
winner_player = world.players[1]
|
||||
|
||||
winner_label.add_theme_color_override("font_color", winner_player.color)
|
||||
winner_label.text = winner_player.name + " wins!"
|
||||
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("ui_accept"):
|
||||
if world.game_state == World.GameState.Startup:
|
||||
world.game_state = World.GameState.Running
|
||||
if event.is_action_pressed("ui_cancel"):
|
||||
if event.is_action_pressed("ui_menu"):
|
||||
if world.game_state == World.GameState.Finished:
|
||||
world.game_state = World.GameState.Startup
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://7a2ma10hq0qa"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://7a2ma10hq0qa"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b08dmcbgq6jyd" path="res://scenes/PlatformParts/rectangle_platform_big.tscn" id="1_g3vn8"]
|
||||
[ext_resource type="PackedScene" uid="uid://deod1xpjlgljl" path="res://scenes/PlatformParts/heptagon_platform_small.tscn" id="2_cf5t4"]
|
||||
[ext_resource type="PackedScene" uid="uid://0fxjod84sli" path="res://scenes/PlatformParts/heptagon_platform_medium.tscn" id="3_3twio"]
|
||||
[ext_resource type="PackedScene" uid="uid://c62j3c1n688uw" path="res://scenes/Wall.tscn" id="4_2reix"]
|
||||
|
||||
[node name="Platforms" type="Node3D"]
|
||||
|
||||
@@ -40,3 +41,9 @@ transform = Transform3D(0.820272, 0, -0.571974, 0, 1, 0, 0.571974, 0, 0.820272,
|
||||
|
||||
[node name="HeptagonPlatform11" parent="." instance=ExtResource("3_3twio")]
|
||||
transform = Transform3D(0.975802, 0, -0.218654, 0, 1, 0, 0.218654, 0, 0.975802, -1.66098, 1.19209e-07, -2.16745)
|
||||
|
||||
[node name="Wall" parent="." instance=ExtResource("4_2reix")]
|
||||
transform = Transform3D(-0.00234742, 0, 0.999989, 0, 1, 0, -0.499994, 0, -0.00469485, -2.99675, 0, 0.787979)
|
||||
|
||||
[node name="Wall2" parent="." instance=ExtResource("4_2reix")]
|
||||
transform = Transform3D(0.6, 0, 0, 0, 1, 0, 0, 0, 1, -1.71071, 0, 1.61891)
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://0lrpepyejfxg"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://0lrpepyejfxg"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c62j3c1n688uw" path="res://scenes/Wall.tscn" id="1_pf85c"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_p0rqu"]
|
||||
size = Vector3(4, 1, 0.4)
|
||||
@@ -23,16 +25,7 @@ shape = SubResource("BoxShape3D_p0rqu")
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
mesh = SubResource("BoxMesh_237xr")
|
||||
|
||||
[node name="Wall2" type="StaticBody3D" parent="."]
|
||||
transform = Transform3D(0.674444, 0, -0.738326, 0, 1, 0, 0.738326, 0, 0.674444, -1.89943, 0, 1.2094)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Wall2"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
shape = SubResource("BoxShape3D_p0rqu")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Wall2"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
mesh = SubResource("BoxMesh_237xr")
|
||||
[node name="Wall2" parent="." instance=ExtResource("1_pf85c")]
|
||||
|
||||
[node name="Wall3" type="StaticBody3D" parent="."]
|
||||
transform = Transform3D(-0.367962, 0, -0.929841, 0, 1, 0, 0.929841, 0, -0.367962, 6.83599, 0, 3.24005)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://c62j3c1n688uw"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_p0rqu"]
|
||||
size = Vector3(4, 1, 0.4)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mr6ph"]
|
||||
albedo_color = Color(0.670588, 0.262745, 0.262745, 1)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_237xr"]
|
||||
material = SubResource("StandardMaterial3D_mr6ph")
|
||||
size = Vector3(4, 1, 0.4)
|
||||
|
||||
[node name="Wall" type="StaticBody3D"]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
shape = SubResource("BoxShape3D_p0rqu")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
mesh = SubResource("BoxMesh_237xr")
|
||||
Reference in New Issue
Block a user