diff --git a/enemies/enemy.gd b/enemies/enemy.gd index 9136e81..ee1f428 100644 --- a/enemies/enemy.gd +++ b/enemies/enemy.gd @@ -62,6 +62,7 @@ func hit(proj: Node3D, damage: float) -> bool: health -= damage if health <= 0: queue_free() + SignalBus.enemy_destroyed.emit() else: if proj is PlayerProjectile: knockback = proj.velocity * 2. * knockback_mul * proj.knockback_mul diff --git a/enemies/police_car/weak_point.gd b/enemies/police_car/weak_point.gd index e519e0f..120bd2b 100644 --- a/enemies/police_car/weak_point.gd +++ b/enemies/police_car/weak_point.gd @@ -28,4 +28,6 @@ func hit(proj: Node3D, _damage: float) -> bool: parent.queue_free() + SignalBus.perfect_shot_hit.emit() + return weak_point_hit diff --git a/levels/base_level.tscn b/levels/base_level.tscn index 4dfb996..5c3e251 100644 --- a/levels/base_level.tscn +++ b/levels/base_level.tscn @@ -4,6 +4,8 @@ [ext_resource type="PackedScene" uid="uid://cv5p3w87nk0wn" path="res://player/player.tscn" id="1_wevqg"] [ext_resource type="Script" uid="uid://bayj73ugmsbd" path="res://levels/enemy_spawner.gd" id="2_ew5uy"] [ext_resource type="Script" uid="uid://da57frm5l63c8" path="res://levels/results_screen.gd" id="4_satuh"] +[ext_resource type="Theme" uid="uid://bqs58u70wa6gd" path="res://parking_citation.tres" id="5_46036"] +[ext_resource type="Texture2D" uid="uid://bqtkxrfh5yyfn" path="res://ui/vecteezy_crumpled-paper-texture_1227306.jpg" id="6_maq6b"] [sub_resource type="NavigationMesh" id="NavigationMesh_4y4yw"] vertices = PackedVector3Array(-24, 0.4634713, -13, -19.25, 0.4634713, -13, -17.75, 0.4634713, -13.75, -24, 0.4634713, -36.5, -5, 0.4634713, -13.75, -4.75, 0.4634713, -36.5, -2.75, 0.4634713, -13.5, -2, 0.4634713, -12.75, 1.5, 0.4634713, -12.75, 2.25, 0.4634713, -13.5, 4.5, 0.4634713, -13.75, 4.25, 0.4634713, -36.5, 19, 0.4634713, -12.75, 19, 0.4634713, -10.75, 24, 0.4634713, -10.75, 18.25, 0.4634713, -13.5, 24, 0.4634713, -36.5, -19.75, 0.4634713, -6.5, -19.25, 0.4634713, -6.75, -19.25, 0.4634713, -8.5, -19.75, 0.4634713, -8.75, -19.75, 0.4634713, -9.5, -19.25, 0.4634713, -9.75, -19.25, 0.4634713, -11.5, -19.75, 0.4634713, -11.75, -24, 0.4634713, -4.25, -19.75, 0.4634713, -12.5, -19.25, 0.4634713, -4.5, 1.25, 0.4634713, -6.5, 1.75, 0.4634713, -6.75, 1.75, 0.4634713, -8.5, 1.25, 0.4634713, -8.75, 1.25, 0.4634713, -9.5, 1.75, 0.4634713, -9.75, 1.75, 0.4634713, -11.5, 1.25, 0.4634713, -11.75, -2, 0.4634713, -4.75, 1.75, 0.4634713, -5, 1.25, 0.4634713, -5.75, -17.25, 5.4634714, -11.5, -17.25, 5.4634714, -4.25, -4, 5.4634714, -4.25, -4, 5.4634714, -11.5, 3.75, 5.4634714, -11.5, 3.75, 5.4634714, -4.25, 17, 5.4634714, -4.25, 17, 5.4634714, -11.5, -17, 0.9634713, -11.25, -17, 0.9634713, -10.5, -16.25, 0.9634713, -10.5, -16.25, 1.2134713, -11.25, -14, 0.9634713, -11.25, -14, 0.9634713, -10.5, -13.25, 0.9634713, -10.5, -13.25, 1.2134713, -11.25, -11, 0.9634713, -11.25, -11, 0.9634713, -10.5, -10.25, 0.9634713, -10.5, -10.25, 1.2134713, -11.25, -8, 0.9634713, -11.25, -8, 0.9634713, -10.5, -7.25, 0.9634713, -10.5, -7.25, 1.2134713, -11.25, -5, 0.9634713, -11.25, -5, 0.9634713, -10.5, -4.25, 0.9634713, -10.5, -4.25, 1.2134713, -11.25, 4, 0.9634713, -11.25, 4, 0.9634713, -10.5, 4.75, 0.9634713, -10.5, 4.75, 1.2134713, -11.25, 7, 0.9634713, -11.25, 7, 0.9634713, -10.5, 7.75, 0.9634713, -10.5, 7.75, 1.2134713, -11.25, 10, 0.9634713, -11.25, 10, 0.9634713, -10.5, 10.75, 0.9634713, -10.5, 10.75, 1.2134713, -11.25, 13, 0.9634713, -11.25, 13, 0.9634713, -10.5, 13.75, 0.9634713, -10.5, 13.75, 1.2134713, -11.25, 16, 0.9634713, -11.25, 16, 0.9634713, -10.5, 16.75, 0.9634713, -10.5, 16.75, 1.2134713, -11.25, 19, 0.4634713, -5, 24, 0.4634713, -5, -17, 0.9634713, -8.25, -17, 0.9634713, -7.5, -16.25, 0.9634713, -7.5, -16.25, 1.2134713, -8.25, -14, 0.9634713, -8.25, -14, 0.9634713, -7.5, -13.25, 0.9634713, -7.5, -13.25, 1.2134713, -8.25, -11, 0.9634713, -8.25, -11, 0.9634713, -7.5, -10.25, 0.9634713, -7.5, -10.25, 1.2134713, -8.25, -8, 0.9634713, -8.25, -8, 0.9634713, -7.5, -7.25, 0.9634713, -7.5, -7.25, 1.2134713, -8.25, -5, 0.9634713, -8.25, -5, 0.9634713, -7.5, -4.25, 0.9634713, -7.5, -4.25, 1.2134713, -8.25, 4, 0.9634713, -8.25, 4, 0.9634713, -7.5, 4.75, 0.9634713, -7.5, 4.75, 1.2134713, -8.25, 7, 0.9634713, -8.25, 7, 0.9634713, -7.5, 7.75, 0.9634713, -7.5, 7.75, 1.2134713, -8.25, 10, 0.9634713, -8.25, 10, 0.9634713, -7.5, 10.75, 0.9634713, -7.5, 10.75, 1.2134713, -8.25, 13, 0.9634713, -8.25, 13, 0.9634713, -7.5, 13.75, 0.9634713, -7.5, 13.75, 1.2134713, -8.25, 16, 0.9634713, -8.25, 16, 0.9634713, -7.5, 16.75, 0.9634713, -7.5, 16.75, 1.2134713, -8.25, -17, 0.9634713, -5.25, -17, 0.9634713, -4.5, -16.25, 0.9634713, -4.5, -16.25, 1.2134713, -5.25, -14, 0.9634713, -5.25, -14, 0.9634713, -4.5, -13.25, 0.9634713, -4.5, -13.25, 1.2134713, -5.25, -11, 0.9634713, -5.25, -11, 0.9634713, -4.5, -10.25, 0.9634713, -4.5, -10.25, 1.2134713, -5.25, -8, 0.9634713, -5.25, -8, 0.9634713, -4.5, -7.25, 0.9634713, -4.5, -7.25, 1.2134713, -5.25, -5, 0.9634713, -5.25, -5, 0.9634713, -4.5, -4.25, 0.9634713, -4.5, -4.25, 1.2134713, -5.25, 4, 0.9634713, -5.25, 4, 0.9634713, -4.5, 4.75, 0.9634713, -4.5, 4.75, 1.2134713, -5.25, 7, 0.9634713, -5.25, 7, 0.9634713, -4.5, 7.75, 0.9634713, -4.5, 7.75, 1.2134713, -5.25, 10, 0.9634713, -5.25, 10, 0.9634713, -4.5, 10.75, 0.9634713, -4.5, 10.75, 1.2134713, -5.25, 13, 0.9634713, -5.25, 13, 0.9634713, -4.5, 13.75, 0.9634713, -4.5, 13.75, 1.2134713, -5.25, 16, 0.9634713, -5.25, 16, 0.9634713, -4.5, 16.75, 0.9634713, -4.5, 16.75, 1.2134713, -5.25, 18.25, 0.4634713, -2.25, 16.5, 0.4634713, -2.25, 16.5, 0.4634713, 1.25, 18.25, 0.4634713, 1.5, 19, 0.4634713, 2.25, 19, 0.4634713, 4.25, 24, 0.4634713, 4.25, 19, 0.4634713, -3, 2.25, 0.4634713, 1.5, 3, 0.4634713, 1.5, 3, 0.4634713, -2, -2.75, 0.4634713, -2.25, -4.5, 0.4634713, -2.25, -4.5, 0.4634713, 1.25, -2.75, 0.4634713, 1.5, 1.5, 0.4634713, 2.25, 1.75, 0.4634713, -3, -2, 0.4634713, -3, -2, 0.4634713, 2.25, -19.25, 0.4634713, 2, -18, 0.4634713, 1.5, -18, 0.4634713, -2, -19.25, 0.4634713, -3, -24, 0.4634713, 2, -19.75, 0.4634713, 8.5, -19.25, 0.4634713, 8.25, -19.25, 0.4634713, 6.5, -19.75, 0.4634713, 6.25, -19.75, 0.4634713, 5.5, -19.25, 0.4634713, 5.25, -19.25, 0.4634713, 3.5, -19.75, 0.4634713, 3.25, -24, 0.4634713, 10.75, -19.75, 0.4634713, 2.5, -19.25, 0.4634713, 10.5, 1.25, 0.4634713, 8.5, 1.75, 0.4634713, 8.25, 1.75, 0.4634713, 6.5, 1.25, 0.4634713, 6.25, 1.25, 0.4634713, 5.5, 1.75, 0.4634713, 5.25, 1.75, 0.4634713, 3.5, 1.25, 0.4634713, 3.25, -2, 0.4634713, 10.25, 1.75, 0.4634713, 10, 1.25, 0.4634713, 9.25, -17.25, 5.4634714, 3.5, -17.25, 5.4634714, 10.75, -4, 5.4634714, 10.75, -4, 5.4634714, 3.5, 3.75, 5.4634714, 3.5, 3.75, 5.4634714, 10.75, 17, 5.4634714, 10.75, 17, 5.4634714, 3.5, -17, 0.9634713, 3.75, -17, 0.9634713, 4.5, -16.25, 0.9634713, 4.5, -16.25, 1.2134713, 3.75, -14, 0.9634713, 3.75, -14, 0.9634713, 4.5, -13.25, 0.9634713, 4.5, -13.25, 1.2134713, 3.75, -11, 0.9634713, 3.75, -11, 0.9634713, 4.5, -10.25, 0.9634713, 4.5, -10.25, 1.2134713, 3.75, -8, 0.9634713, 3.75, -8, 0.9634713, 4.5, -7.25, 0.9634713, 4.5, -7.25, 1.2134713, 3.75, -5, 0.9634713, 3.75, -5, 0.9634713, 4.5, -4.25, 0.9634713, 4.5, -4.25, 1.2134713, 3.75, 4, 0.9634713, 3.75, 4, 0.9634713, 4.5, 4.75, 0.9634713, 4.5, 4.75, 1.2134713, 3.75, 7, 0.9634713, 3.75, 7, 0.9634713, 4.5, 7.75, 0.9634713, 4.5, 7.75, 1.2134713, 3.75, 10, 0.9634713, 3.75, 10, 0.9634713, 4.5, 10.75, 0.9634713, 4.5, 10.75, 1.2134713, 3.75, 13, 0.9634713, 3.75, 13, 0.9634713, 4.5, 13.75, 0.9634713, 4.5, 13.75, 1.2134713, 3.75, 16, 0.9634713, 3.75, 16, 0.9634713, 4.5, 16.75, 0.9634713, 4.5, 16.75, 1.2134713, 3.75, 19, 0.4634713, 10, 24, 0.4634713, 10, -17, 0.9634713, 6.75, -17, 0.9634713, 7.5, -16.25, 0.9634713, 7.5, -16.25, 1.2134713, 6.75, -14, 0.9634713, 6.75, -14, 0.9634713, 7.5, -13.25, 0.9634713, 7.5, -13.25, 1.2134713, 6.75, -11, 0.9634713, 6.75, -11, 0.9634713, 7.5, -10.25, 0.9634713, 7.5, -10.25, 1.2134713, 6.75, -8, 0.9634713, 6.75, -8, 0.9634713, 7.5, -7.25, 0.9634713, 7.5, -7.25, 1.2134713, 6.75, -5, 0.9634713, 6.75, -5, 0.9634713, 7.5, -4.25, 0.9634713, 7.5, -4.25, 1.2134713, 6.75, 4, 0.9634713, 6.75, 4, 0.9634713, 7.5, 4.75, 0.9634713, 7.5, 4.75, 1.2134713, 6.75, 7, 0.9634713, 6.75, 7, 0.9634713, 7.5, 7.75, 0.9634713, 7.5, 7.75, 1.2134713, 6.75, 10, 0.9634713, 6.75, 10, 0.9634713, 7.5, 10.75, 0.9634713, 7.5, 10.75, 1.2134713, 6.75, 13, 0.9634713, 6.75, 13, 0.9634713, 7.5, 13.75, 0.9634713, 7.5, 13.75, 1.2134713, 6.75, 16, 0.9634713, 6.75, 16, 0.9634713, 7.5, 16.75, 0.9634713, 7.5, 16.75, 1.2134713, 6.75, -17, 0.9634713, 9.75, -17, 0.9634713, 10.5, -16.25, 0.9634713, 10.5, -16.25, 1.2134713, 9.75, -14, 0.9634713, 9.75, -14, 0.9634713, 10.5, -13.25, 0.9634713, 10.5, -13.25, 1.2134713, 9.75, -11, 0.9634713, 9.75, -11, 0.9634713, 10.5, -10.25, 0.9634713, 10.5, -10.25, 1.2134713, 9.75, -8, 0.9634713, 9.75, -8, 0.9634713, 10.5, -7.25, 0.9634713, 10.5, -7.25, 1.2134713, 9.75, -5, 0.9634713, 9.75, -5, 0.9634713, 10.5, -4.25, 0.9634713, 10.5, -4.25, 1.2134713, 9.75, 4, 0.9634713, 9.75, 4, 0.9634713, 10.5, 4.75, 0.9634713, 10.5, 4.75, 1.2134713, 9.75, 7, 0.9634713, 9.75, 7, 0.9634713, 10.5, 7.75, 0.9634713, 10.5, 7.75, 1.2134713, 9.75, 10, 0.9634713, 9.75, 10, 0.9634713, 10.5, 10.75, 0.9634713, 10.5, 10.75, 1.2134713, 9.75, 13, 0.9634713, 9.75, 13, 0.9634713, 10.5, 13.75, 0.9634713, 10.5, 13.75, 1.2134713, 9.75, 16, 0.9634713, 9.75, 16, 0.9634713, 10.5, 16.75, 0.9634713, 10.5, 16.75, 1.2134713, 9.75, 18.25, 0.4634713, 12.75, 16.5, 0.4634713, 12.75, 16.5, 0.4634713, 16.25, 18.25, 0.4634713, 16.5, 19, 0.4634713, 17.25, 19, 0.4634713, 19.25, 24, 0.4634713, 19.25, 19, 0.4634713, 12, 2.25, 0.4634713, 16.5, 3, 0.4634713, 16.5, 3, 0.4634713, 13, -2.75, 0.4634713, 12.75, -4.5, 0.4634713, 12.75, -4.5, 0.4634713, 16.25, -2.75, 0.4634713, 16.5, 1.5, 0.4634713, 17.25, 1.75, 0.4634713, 12, -2, 0.4634713, 12, -2, 0.4634713, 17.25, -19.25, 0.4634713, 17, -18, 0.4634713, 16.5, -18, 0.4634713, 13, -19.25, 0.4634713, 12, -24, 0.4634713, 17, -19.75, 0.4634713, 23.5, -19.25, 0.4634713, 23.25, -19.25, 0.4634713, 21.5, -19.75, 0.4634713, 21.25, -19.75, 0.4634713, 20.5, -19.25, 0.4634713, 20.25, -19.25, 0.4634713, 18.5, -19.75, 0.4634713, 18.25, -24, 0.4634713, 25.75, -19.75, 0.4634713, 17.5, -19.25, 0.4634713, 25.5, 1.25, 0.4634713, 23.5, 1.75, 0.4634713, 23.25, 1.75, 0.4634713, 21.5, 1.25, 0.4634713, 21.25, 1.25, 0.4634713, 20.5, 1.75, 0.4634713, 20.25, 1.75, 0.4634713, 18.5, 1.25, 0.4634713, 18.25, -2, 0.4634713, 25.25, 1.75, 0.4634713, 25, 1.25, 0.4634713, 24.25, -17.25, 5.4634714, 18.5, -17.25, 5.4634714, 25.75, -4, 5.4634714, 25.75, -4, 5.4634714, 18.5, 3.75, 5.4634714, 18.5, 3.75, 5.4634714, 25.75, 17, 5.4634714, 25.75, 17, 5.4634714, 18.5, -17, 0.9634713, 18.75, -17, 0.9634713, 19.5, -16.25, 0.9634713, 19.5, -16.25, 1.2134713, 18.75, -14, 0.9634713, 18.75, -14, 0.9634713, 19.5, -13.25, 0.9634713, 19.5, -13.25, 1.2134713, 18.75, -11, 0.9634713, 18.75, -11, 0.9634713, 19.5, -10.25, 0.9634713, 19.5, -10.25, 1.2134713, 18.75, -8, 0.9634713, 18.75, -8, 0.9634713, 19.5, -7.25, 0.9634713, 19.5, -7.25, 1.2134713, 18.75, -5, 0.9634713, 18.75, -5, 0.9634713, 19.5, -4.25, 0.9634713, 19.5, -4.25, 1.2134713, 18.75, 4, 0.9634713, 18.75, 4, 0.9634713, 19.5, 4.75, 0.9634713, 19.5, 4.75, 1.2134713, 18.75, 7, 0.9634713, 18.75, 7, 0.9634713, 19.5, 7.75, 0.9634713, 19.5, 7.75, 1.2134713, 18.75, 10, 0.9634713, 18.75, 10, 0.9634713, 19.5, 10.75, 0.9634713, 19.5, 10.75, 1.2134713, 18.75, 13, 0.9634713, 18.75, 13, 0.9634713, 19.5, 13.75, 0.9634713, 19.5, 13.75, 1.2134713, 18.75, 16, 0.9634713, 18.75, 16, 0.9634713, 19.5, 16.75, 0.9634713, 19.5, 16.75, 1.2134713, 18.75, 19, 0.4634713, 25, 24, 0.4634713, 25, -17, 0.9634713, 21.75, -17, 0.9634713, 22.5, -16.25, 0.9634713, 22.5, -16.25, 1.2134713, 21.75, -14, 0.9634713, 21.75, -14, 0.9634713, 22.5, -13.25, 0.9634713, 22.5, -13.25, 1.2134713, 21.75, -11, 0.9634713, 21.75, -11, 0.9634713, 22.5, -10.25, 0.9634713, 22.5, -10.25, 1.2134713, 21.75, -8, 0.9634713, 21.75, -8, 0.9634713, 22.5, -7.25, 0.9634713, 22.5, -7.25, 1.2134713, 21.75, -5, 0.9634713, 21.75, -5, 0.9634713, 22.5, -4.25, 0.9634713, 22.5, -4.25, 1.2134713, 21.75, 4, 0.9634713, 21.75, 4, 0.9634713, 22.5, 4.75, 0.9634713, 22.5, 4.75, 1.2134713, 21.75, 7, 0.9634713, 21.75, 7, 0.9634713, 22.5, 7.75, 0.9634713, 22.5, 7.75, 1.2134713, 21.75, 10, 0.9634713, 21.75, 10, 0.9634713, 22.5, 10.75, 0.9634713, 22.5, 10.75, 1.2134713, 21.75, 13, 0.9634713, 21.75, 13, 0.9634713, 22.5, 13.75, 0.9634713, 22.5, 13.75, 1.2134713, 21.75, 16, 0.9634713, 21.75, 16, 0.9634713, 22.5, 16.75, 0.9634713, 22.5, 16.75, 1.2134713, 21.75, -17, 0.9634713, 24.75, -17, 0.9634713, 25.5, -16.25, 0.9634713, 25.5, -16.25, 1.2134713, 24.75, -14, 0.9634713, 24.75, -14, 0.9634713, 25.5, -13.25, 0.9634713, 25.5, -13.25, 1.2134713, 24.75, -11, 0.9634713, 24.75, -11, 0.9634713, 25.5, -10.25, 0.9634713, 25.5, -10.25, 1.2134713, 24.75, -8, 0.9634713, 24.75, -8, 0.9634713, 25.5, -7.25, 0.9634713, 25.5, -7.25, 1.2134713, 24.75, -5, 0.9634713, 24.75, -5, 0.9634713, 25.5, -4.25, 0.9634713, 25.5, -4.25, 1.2134713, 24.75, 4, 0.9634713, 24.75, 4, 0.9634713, 25.5, 4.75, 0.9634713, 25.5, 4.75, 1.2134713, 24.75, 7, 0.9634713, 24.75, 7, 0.9634713, 25.5, 7.75, 0.9634713, 25.5, 7.75, 1.2134713, 24.75, 10, 0.9634713, 24.75, 10, 0.9634713, 25.5, 10.75, 0.9634713, 25.5, 10.75, 1.2134713, 24.75, 13, 0.9634713, 24.75, 13, 0.9634713, 25.5, 13.75, 0.9634713, 25.5, 13.75, 1.2134713, 24.75, 16, 0.9634713, 24.75, 16, 0.9634713, 25.5, 16.75, 0.9634713, 25.5, 16.75, 1.2134713, 24.75, 19, 0.4634713, 27, 18.25, 0.4634713, 27.75, 15.25, 0.4634713, 36.5, 24, 0.4634713, 36.5, 15.25, 0.4634713, 28, 1.75, 0.4634713, 27, -2, 0.4634713, 27, 3, 0.4634713, 28, -2.75, 0.4634713, 27.75, -4.25, 0.4634713, 27.75, -4, 0.4634713, 36.5, 3, 0.4634713, 36.5, -19.25, 0.4634713, 27, -18, 0.4634713, 28, -24, 0.4634713, 36.5, -18, 0.4634713, 36.5) @@ -12,6 +14,11 @@ geometry_collision_mask = 4294901761 geometry_source_geometry_mode = 1 agent_radius = 1.0 +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_0rg8l"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6w4ab"] +bg_color = Color(0, 0, 0, 1) + [node name="BaseLevel" type="Node3D" unique_id=815380624] script = ExtResource("1_63c5o") @@ -56,65 +63,182 @@ autostart = true [node name="ResultsScreen" type="CanvasLayer" parent="." unique_id=1885670836] unique_name_in_owner = true -visible = false script = ExtResource("4_satuh") -[node name="PanelContainer" type="Panel" parent="ResultsScreen" unique_id=134388601] +[node name="PanelContainer" type="PanelContainer" parent="ResultsScreen" unique_id=1295223482] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -offset_left = -387.0 -offset_top = -203.0 -offset_right = 387.0 -offset_bottom = 203.0 +offset_left = -295.0 +offset_top = -303.0 +offset_right = 295.0 +offset_bottom = 303.0 grow_horizontal = 2 grow_vertical = 2 +theme = ExtResource("5_46036") +theme_override_styles/panel = SubResource("StyleBoxEmpty_0rg8l") -[node name="Label" type="Label" parent="ResultsScreen/PanelContainer" unique_id=677407499] -layout_mode = 1 -anchors_preset = 5 -anchor_left = 0.5 -anchor_right = 0.5 -offset_left = -87.0 -offset_right = 87.0 -offset_bottom = 63.0 -grow_horizontal = 2 +[node name="ColorRect" type="ColorRect" parent="ResultsScreen/PanelContainer" unique_id=803600956] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="ResultsScreen/PanelContainer" unique_id=980262275] +modulate = Color(1, 1, 1, 0.5372549) +layout_mode = 2 +texture = ExtResource("6_maq6b") +expand_mode = 1 + +[node name="VBoxContainer" type="VBoxContainer" parent="ResultsScreen/PanelContainer" unique_id=1238482271] +layout_mode = 2 + +[node name="MarginContainer2" type="MarginContainer" parent="ResultsScreen/PanelContainer/VBoxContainer" unique_id=1493042601] +layout_mode = 2 +theme_override_constants/margin_left = 15 +theme_override_constants/margin_top = 15 +theme_override_constants/margin_right = 15 +theme_override_constants/margin_bottom = 15 + +[node name="Header" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer2" unique_id=677407499] +custom_minimum_size = Vector2(500, 80) +layout_mode = 2 +size_flags_vertical = 3 +theme = ExtResource("5_46036") +theme_override_colors/font_color = Color(1, 1, 1, 1) theme_override_font_sizes/font_size = 45 -text = "you ded" +theme_override_styles/normal = SubResource("StyleBoxFlat_6w4ab") +text = "PARKING CITATION" +horizontal_alignment = 1 +vertical_alignment = 1 -[node name="Restart" type="Button" parent="ResultsScreen/PanelContainer" unique_id=1572910890] -layout_mode = 1 -anchors_preset = 7 -anchor_left = 0.5 -anchor_top = 1.0 -anchor_right = 0.5 -anchor_bottom = 1.0 -offset_left = -60.0 -offset_top = -101.0 -offset_right = 60.0 -offset_bottom = -48.0 -grow_horizontal = 2 -grow_vertical = 0 -theme_override_font_sizes/font_size = 32 +[node name="Spacer3" type="Control" parent="ResultsScreen/PanelContainer/VBoxContainer" unique_id=152516936] +custom_minimum_size = Vector2(0, 26.655) +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="ResultsScreen/PanelContainer/VBoxContainer" unique_id=440706405] +layout_mode = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_right = 20 + +[node name="GridContainer" type="GridContainer" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer" unique_id=894381558] +layout_mode = 2 +columns = 2 + +[node name="Label2" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=1177889474] +layout_mode = 2 +size_flags_horizontal = 3 +text = "SCORE" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="Score" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=1682959270] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "6969" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="Label" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=1681197045] +layout_mode = 2 +size_flags_horizontal = 3 +text = "BUILDINGS DESTROYED" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="BuildingsDestroyed" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=327348617] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "300" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="Label3" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=952236397] +layout_mode = 2 +size_flags_horizontal = 3 +text = "POLICE ELIMINATED" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="PoliceEliminated" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=1715631788] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "39" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="Label5" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=103508898] +layout_mode = 2 +size_flags_horizontal = 3 +text = "PERFECT SHOTS" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="PerfectShots" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=899623362] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "934" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="Label6" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=1152067429] +layout_mode = 2 +size_flags_horizontal = 3 +text = "CHASE DURATION" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="ChaseDuration" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=1102360844] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "5:34" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="Label7" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=1379456002] +layout_mode = 2 +size_flags_horizontal = 3 +text = "DISTANCE TRAVELED" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="DistanceTraveled" type="Label" parent="ResultsScreen/PanelContainer/VBoxContainer/MarginContainer/GridContainer" unique_id=2046395120] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "394m" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="Spacer2" type="Control" parent="ResultsScreen/PanelContainer/VBoxContainer" unique_id=788510245] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="HBoxContainer" type="HBoxContainer" parent="ResultsScreen/PanelContainer/VBoxContainer" unique_id=398331451] +layout_mode = 2 +size_flags_horizontal = 4 + +[node name="Restart" type="Button" parent="ResultsScreen/PanelContainer/VBoxContainer/HBoxContainer" unique_id=1572910890] +layout_mode = 2 +size_flags_horizontal = 6 +theme = ExtResource("5_46036") text = "Restart" -[node name="Quit" type="Button" parent="ResultsScreen/PanelContainer" unique_id=883831658] -layout_mode = 1 -anchors_preset = 7 -anchor_left = 0.5 -anchor_top = 1.0 -anchor_right = 0.5 -anchor_bottom = 1.0 -offset_left = -32.5 -offset_top = -31.0 -offset_right = 32.5 -grow_horizontal = 2 -grow_vertical = 0 -text = "Quit" +[node name="Quit" type="Button" parent="ResultsScreen/PanelContainer/VBoxContainer/HBoxContainer" unique_id=883831658] +layout_mode = 2 +size_flags_horizontal = 6 +theme = ExtResource("5_46036") +text = "Title Screen" + +[node name="Spacer" type="Control" parent="ResultsScreen/PanelContainer/VBoxContainer" unique_id=356831025] +custom_minimum_size = Vector2(0, 34.6) +layout_mode = 2 [connection signal="died" from="Player" to="." method="_on_player_died"] [connection signal="timeout" from="EnemySpawner/Timer" to="EnemySpawner" method="_on_timer_timeout"] -[connection signal="pressed" from="ResultsScreen/PanelContainer/Restart" to="ResultsScreen" method="_on_restart_pressed"] -[connection signal="pressed" from="ResultsScreen/PanelContainer/Quit" to="ResultsScreen" method="_on_quit_pressed"] +[connection signal="pressed" from="ResultsScreen/PanelContainer/VBoxContainer/HBoxContainer/Restart" to="ResultsScreen" method="_on_restart_pressed"] +[connection signal="pressed" from="ResultsScreen/PanelContainer/VBoxContainer/HBoxContainer/Quit" to="ResultsScreen" method="_on_quit_pressed"] diff --git a/levels/results_screen.gd b/levels/results_screen.gd index e5b6cc4..6980236 100644 --- a/levels/results_screen.gd +++ b/levels/results_screen.gd @@ -1,8 +1,38 @@ extends CanvasLayer +var buildings_destroyed_count := 0 +var police_eliminated_count := 0 +var perfect_shot_count := 0 + +@onready var score_label: Label = %Score +@onready var buildings_destroyed_label: Label = %BuildingsDestroyed +@onready var police_eliminated_label: Label = %PoliceEliminated +@onready var perfect_shots_label: Label = %PerfectShots +@onready var chase_duration_label: Label = %ChaseDuration +@onready var distance_traveled_label: Label = %DistanceTraveled + +func update_labels() -> void: + score_label.text = str(ScoreLabel.instance.score) + + buildings_destroyed_label.text = str(buildings_destroyed_count) + police_eliminated_label.text = str(police_eliminated_count) + perfect_shots_label.text = str(perfect_shot_count) + + var delta = Time.get_ticks_msec() - Level.level.start_time_msec + var seconds = delta / 1000 + var minutes = seconds / 60 + seconds = seconds % 60 + chase_duration_label.text = "%d:%02d" % [minutes, seconds] + + distance_traveled_label.text = "%dm" % int(roundf(Player.instance.distance_traveled)) + func _on_restart_pressed() -> void: get_tree().reload_current_scene() func _on_quit_pressed() -> void: get_tree().quit() +func _ready() -> void: + SignalBus.building_destroyed.connect(func(_b, _s): buildings_destroyed_count += 1) + SignalBus.enemy_destroyed.connect(func(): police_eliminated_count += 1) + SignalBus.perfect_shot_hit.connect(func(): perfect_shot_count += 1) diff --git a/parking_citation.tres b/parking_citation.tres new file mode 100644 index 0000000..5c0b797 --- /dev/null +++ b/parking_citation.tres @@ -0,0 +1,47 @@ +[gd_resource type="Theme" format=3 uid="uid://bqs58u70wa6gd"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_16ibj"] +bg_color = Color(0.46, 0.46, 0.46, 0.28627452) +border_width_left = 3 +border_width_top = 3 +border_width_right = 6 +border_width_bottom = 7 +border_color = Color(0, 0, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dt5rt"] +bg_color = Color(0.6, 0.6, 0.6, 0) +border_width_left = 3 +border_width_top = 3 +border_width_right = 6 +border_width_bottom = 7 +border_color = Color(0, 0, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_myosa"] +bg_color = Color(0.6, 0.6, 0.6, 0) +border_width_left = 3 +border_width_top = 3 +border_width_right = 3 +border_width_bottom = 3 +border_color = Color(0, 0, 0, 1) +expand_margin_left = 5.0 +expand_margin_top = 5.0 +expand_margin_right = 5.0 +expand_margin_bottom = 5.0 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ugcl0"] +bg_color = Color(1, 1, 1, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_suww5"] +bg_color = Color(1, 1, 1, 1) + +[resource] +Button/colors/font_color = Color(0, 0, 0, 1) +Button/colors/font_hover_color = Color(0, 0, 0, 1) +Button/font_sizes/font_size = 32 +Button/styles/hover = SubResource("StyleBoxFlat_16ibj") +Button/styles/normal = SubResource("StyleBoxFlat_dt5rt") +Label/colors/font_color = Color(0, 0, 0, 1) +Label/font_sizes/font_size = 28 +Label/styles/normal = SubResource("StyleBoxFlat_myosa") +Panel/styles/panel = SubResource("StyleBoxFlat_ugcl0") +PanelContainer/styles/panel = SubResource("StyleBoxFlat_suww5") diff --git a/player/player.gd b/player/player.gd index be49d5f..de70f14 100644 --- a/player/player.gd +++ b/player/player.gd @@ -45,6 +45,8 @@ var gun_index := 0: var gun: Gun: get: return guns[gun_index] +var distance_traveled := 0. + func clean_angle(theta: float) -> float: theta = fposmod(theta, TAU) if theta < PI: return theta @@ -145,6 +147,7 @@ func _process(delta: float) -> void: State.NORMAL: _process_movement(delta) State.DASHING: _process_dash() State.LOCKED: pass + distance_traveled += velocity.length() * delta _process_aim() diff --git a/player/score_label.gd b/player/score_label.gd index 13c64bd..f7dfefc 100644 --- a/player/score_label.gd +++ b/player/score_label.gd @@ -1,7 +1,10 @@ +class_name ScoreLabel extends Control const DESIRED_SCALE := Vector2.ONE * .5 +static var instance: ScoreLabel + @onready var label: Label = get_child(0) var tween: Tween var _display_score := 0 @@ -23,6 +26,9 @@ var score := 0: func exp_lerp(a: Variant, b: Variant, decay: float, dt: float) -> Variant: return lerp(a, b, 1 - exp(-decay * dt)) +func _init() -> void: + instance = self + func _ready() -> void: scale = DESIRED_SCALE score = score diff --git a/ui/vecteezy_crumpled-paper-texture_1227306.jpg b/ui/vecteezy_crumpled-paper-texture_1227306.jpg new file mode 100644 index 0000000..ecdf2b2 Binary files /dev/null and b/ui/vecteezy_crumpled-paper-texture_1227306.jpg differ diff --git a/ui/vecteezy_crumpled-paper-texture_1227306.jpg.import b/ui/vecteezy_crumpled-paper-texture_1227306.jpg.import new file mode 100644 index 0000000..3f762e6 --- /dev/null +++ b/ui/vecteezy_crumpled-paper-texture_1227306.jpg.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bqtkxrfh5yyfn" +path="res://.godot/imported/vecteezy_crumpled-paper-texture_1227306.jpg-d5817539067c1b0b5972678c937e9510.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/vecteezy_crumpled-paper-texture_1227306.jpg" +dest_files=["res://.godot/imported/vecteezy_crumpled-paper-texture_1227306.jpg-d5817539067c1b0b5972678c937e9510.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/utils/signal_bus.gd b/utils/signal_bus.gd index ba0b847..34f5a75 100644 --- a/utils/signal_bus.gd +++ b/utils/signal_bus.gd @@ -1,3 +1,5 @@ extends Node signal building_destroyed(building: Building, score: int) +signal enemy_destroyed +signal perfect_shot_hit