Prueba de boss final
This commit is contained in:
1 parent
ac1d386143
commit
f414d43a37
6 files changed
+577
No files matched your search
@@ -0,0 +1,56 @@
|
||||
extends LevelRoot
|
||||
## Pasillo, puerta de exterminio y descenso a la camara final.
|
||||
const LOCKED_TEXT: String = "has de derrotar a todos los mal nacidos para poder atravesar esta puerta!"
|
||||
var remaining: int = 0
|
||||
var _gate_open: bool = false
|
||||
var _boss_defeated: bool = false
|
||||
|
||||
@onready var gate: StaticBody2D = $Gate
|
||||
@onready var gate_shape: CollisionShape2D = $Gate/CollisionShape2D
|
||||
@onready var gate_visual: Polygon2D = $Gate/Visual
|
||||
@onready var notice: Label = $GateMessage/Text
|
||||
@onready var boss: Node2D = $Boss
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
for enemy: Node in $Enemies.get_children():
|
||||
if enemy.has_signal("died"):
|
||||
remaining += 1
|
||||
enemy.connect("died", _on_enemy_died)
|
||||
boss.connect("died", _on_boss_died)
|
||||
$GateSensor.body_entered.connect(_on_gate_approach)
|
||||
$GateSensor.body_exited.connect(_on_gate_depart)
|
||||
_update_gate()
|
||||
|
||||
func _on_enemy_died() -> void:
|
||||
remaining = maxi(0, remaining - 1)
|
||||
_update_gate()
|
||||
|
||||
func _update_gate() -> void:
|
||||
_gate_open = remaining == 0
|
||||
gate_shape.set_deferred("disabled", _gate_open)
|
||||
gate_visual.visible = not _gate_open
|
||||
if _gate_open:
|
||||
notice.text = "TODOS DERROTADOS. EL SELLO SE HA ROTO."
|
||||
else:
|
||||
notice.text = LOCKED_TEXT
|
||||
|
||||
func _on_gate_approach(body: Node2D) -> void:
|
||||
if body.is_in_group("player"):
|
||||
$GateMessage.visible = true
|
||||
|
||||
func _on_gate_depart(body: Node2D) -> void:
|
||||
if body.is_in_group("player"):
|
||||
$GateMessage.visible = false
|
||||
|
||||
func _on_boss_died() -> void:
|
||||
if _boss_defeated:
|
||||
return
|
||||
_boss_defeated = true
|
||||
progress_notice.emit("LA MUERTE ESPECTRAL HA CAIDO")
|
||||
get_tree().create_timer(1.5).timeout.connect(_finish_after_boss)
|
||||
|
||||
func _finish_after_boss() -> void:
|
||||
if not is_inside_tree():
|
||||
return
|
||||
complete_level()
|
||||
@@ -0,0 +1,192 @@
|
||||
[gd_scene load_steps=16 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://levels/level_02.gd" id="level"]
|
||||
[ext_resource type="Script" path="res://levels/level_02_art.gd" id="art"]
|
||||
[ext_resource type="PackedScene" path="res://player/player.tscn" id="player"]
|
||||
[ext_resource type="PackedScene" path="res://ui/mobile_controls/mobile_controls.tscn" id="mobile"]
|
||||
[ext_resource type="PackedScene" path="res://world/terrain/ground.tscn" id="ground"]
|
||||
[ext_resource type="PackedScene" path="res://world/terrain/platform.tscn" id="platform"]
|
||||
[ext_resource type="PackedScene" path="res://world/terrain/wall.tscn" id="wall"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/roadie.tscn" id="roadie"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/pogo_fan.tscn" id="fan"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/backstage_guard.tscn" id="guard"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/feedback_tech.tscn" id="tech"]
|
||||
[ext_resource type="PackedScene" path="res://bosses/spectral_death/spectral_death.tscn" id="boss"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="gate_collision"]
|
||||
size = Vector2(44, 220)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="gate_sensor"]
|
||||
size = Vector2(320, 260)
|
||||
|
||||
[node name="Level02" type="Node2D"]
|
||||
script = ExtResource("level")
|
||||
camera_bounds = Rect2(0, 0, 4400, 1550)
|
||||
|
||||
[node name="Night" type="Polygon2D" parent="."]
|
||||
z_index = -20
|
||||
color = Color(0.055, 0.045, 0.09, 1)
|
||||
polygon = PackedVector2Array(0, 0, 4400, 0, 4400, 1550, 0, 1550)
|
||||
|
||||
[node name="Crypt" type="Polygon2D" parent="."]
|
||||
z_index = -15
|
||||
color = Color(0.10, 0.075, 0.15, 1)
|
||||
polygon = PackedVector2Array(3070, 690, 4400, 690, 4400, 1550, 3070, 1550)
|
||||
|
||||
[node name="TemporaryArt" type="Node2D" parent="."]
|
||||
z_index = -10
|
||||
script = ExtResource("art")
|
||||
|
||||
[node name="Ground" type="Node2D" parent="."]
|
||||
|
||||
[node name="Road00" parent="Ground" instance=ExtResource("ground")]
|
||||
position = Vector2(275, 860)
|
||||
dimensions = Vector2(550, 260)
|
||||
|
||||
[node name="Road01" parent="Ground" instance=ExtResource("ground")]
|
||||
position = Vector2(805, 830)
|
||||
dimensions = Vector2(550, 260)
|
||||
|
||||
[node name="Road02" parent="Ground" instance=ExtResource("ground")]
|
||||
position = Vector2(1340, 805)
|
||||
dimensions = Vector2(560, 260)
|
||||
|
||||
[node name="Road03" parent="Ground" instance=ExtResource("ground")]
|
||||
position = Vector2(1860, 830)
|
||||
dimensions = Vector2(520, 260)
|
||||
|
||||
[node name="Road04" parent="Ground" instance=ExtResource("ground")]
|
||||
position = Vector2(2350, 810)
|
||||
dimensions = Vector2(500, 260)
|
||||
|
||||
[node name="Road05" parent="Ground" instance=ExtResource("ground")]
|
||||
position = Vector2(2835, 840)
|
||||
dimensions = Vector2(510, 260)
|
||||
|
||||
[node name="Step00" parent="Ground" instance=ExtResource("platform")]
|
||||
position = Vector2(580, 620)
|
||||
dimensions = Vector2(160, 28)
|
||||
|
||||
[node name="Step01" parent="Ground" instance=ExtResource("platform")]
|
||||
position = Vector2(1150, 580)
|
||||
dimensions = Vector2(160, 28)
|
||||
|
||||
[node name="Step02" parent="Ground" instance=ExtResource("platform")]
|
||||
position = Vector2(1720, 605)
|
||||
dimensions = Vector2(160, 28)
|
||||
|
||||
[node name="Step03" parent="Ground" instance=ExtResource("platform")]
|
||||
position = Vector2(2240, 575)
|
||||
dimensions = Vector2(160, 28)
|
||||
|
||||
[node name="Step04" parent="Ground" instance=ExtResource("platform")]
|
||||
position = Vector2(2750, 615)
|
||||
dimensions = Vector2(160, 28)
|
||||
|
||||
[node name="CryptFloor" parent="Ground" instance=ExtResource("ground")]
|
||||
position = Vector2(3720, 1400)
|
||||
dimensions = Vector2(1330, 260)
|
||||
|
||||
[node name="LeftBoundary" parent="Ground" instance=ExtResource("wall")]
|
||||
position = Vector2(-24, 780)
|
||||
dimensions = Vector2(48, 1560)
|
||||
|
||||
[node name="RightBoundary" parent="Ground" instance=ExtResource("wall")]
|
||||
position = Vector2(4375, 780)
|
||||
dimensions = Vector2(48, 1560)
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("player")]
|
||||
position = Vector2(130, 560)
|
||||
special_radius = 290.0
|
||||
|
||||
[node name="Enemies" type="Node2D" parent="."]
|
||||
|
||||
[node name="Foe01" parent="Enemies" instance=ExtResource("roadie")]
|
||||
position = Vector2(400, 570)
|
||||
respawn_delay = 0.0
|
||||
chase_radius = 230.0
|
||||
aggro_range = 195.0
|
||||
|
||||
[node name="Foe02" parent="Enemies" instance=ExtResource("fan")]
|
||||
position = Vector2(790, 540)
|
||||
respawn_delay = 0.0
|
||||
chase_radius = 230.0
|
||||
aggro_range = 195.0
|
||||
|
||||
[node name="Foe03" parent="Enemies" instance=ExtResource("tech")]
|
||||
position = Vector2(1120, 515)
|
||||
respawn_delay = 0.0
|
||||
chase_radius = 230.0
|
||||
aggro_range = 195.0
|
||||
|
||||
[node name="Foe04" parent="Enemies" instance=ExtResource("guard")]
|
||||
position = Vector2(1450, 515)
|
||||
respawn_delay = 0.0
|
||||
chase_radius = 230.0
|
||||
aggro_range = 195.0
|
||||
|
||||
[node name="Foe05" parent="Enemies" instance=ExtResource("roadie")]
|
||||
position = Vector2(1780, 540)
|
||||
respawn_delay = 0.0
|
||||
chase_radius = 230.0
|
||||
aggro_range = 195.0
|
||||
|
||||
[node name="Foe06" parent="Enemies" instance=ExtResource("fan")]
|
||||
position = Vector2(2080, 540)
|
||||
respawn_delay = 0.0
|
||||
chase_radius = 230.0
|
||||
aggro_range = 195.0
|
||||
|
||||
[node name="Foe07" parent="Enemies" instance=ExtResource("tech")]
|
||||
position = Vector2(2380, 520)
|
||||
respawn_delay = 0.0
|
||||
chase_radius = 230.0
|
||||
aggro_range = 195.0
|
||||
|
||||
[node name="Foe08" parent="Enemies" instance=ExtResource("guard")]
|
||||
position = Vector2(2710, 550)
|
||||
respawn_delay = 0.0
|
||||
chase_radius = 230.0
|
||||
aggro_range = 195.0
|
||||
|
||||
[node name="Boss" parent="." instance=ExtResource("boss")]
|
||||
position = Vector2(3840, 1150)
|
||||
|
||||
[node name="Gate" type="StaticBody2D" parent="."]
|
||||
position = Vector2(3070, 600)
|
||||
collision_layer = 1
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Gate"]
|
||||
shape = SubResource("gate_collision")
|
||||
|
||||
[node name="Visual" type="Polygon2D" parent="Gate"]
|
||||
color = Color(0.72, 0.17, 0.30, 0.92)
|
||||
polygon = PackedVector2Array(-22, -110, 22, -110, 22, 110, -22, 110)
|
||||
|
||||
[node name="GateSensor" type="Area2D" parent="."]
|
||||
position = Vector2(3030, 600)
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="GateSensor"]
|
||||
shape = SubResource("gate_sensor")
|
||||
|
||||
[node name="GateMessage" type="CanvasLayer" parent="."]
|
||||
visible = false
|
||||
layer = 4
|
||||
|
||||
[node name="Text" type="Label" parent="GateMessage"]
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_top = 110.0
|
||||
offset_bottom = 170.0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
theme_override_font_sizes/font_size = 18
|
||||
theme_override_colors/font_color = Color(1, 0.83, 0.62, 1)
|
||||
autowrap_mode = 3
|
||||
text = "has de derrotar a todos los mal nacidos para poder atravesar esta puerta!"
|
||||
|
||||
[node name="MobileControls" parent="." instance=ExtResource("mobile")]
|
||||
@@ -0,0 +1,35 @@
|
||||
extends Node2D
|
||||
## Decorado vectorial temporal: cielo, ruinas, antorchas y camara de la Muerte.
|
||||
## Sin sprites externos: el equipo de arte puede reemplazar este nodo completo.
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
queue_redraw()
|
||||
|
||||
func _draw() -> void:
|
||||
var t: float = Time.get_ticks_msec() * 0.001
|
||||
# Ventanas de la ciudad y luminarias del camino.
|
||||
for i: int in range(11):
|
||||
var x: float = 140.0 + i * 268.0
|
||||
var h: float = 240.0 + (i % 4) * 55.0
|
||||
draw_rect(Rect2(x, 620.0 - h, 120, h), Color(0.105, 0.095, 0.15))
|
||||
for row: int in range(3):
|
||||
draw_rect(Rect2(x + 24, 435 - h + row * 68, 16, 24), Color(0.61, 0.27, 0.19, 0.55))
|
||||
draw_line(Vector2(x + 8, 620), Vector2(x + 8, 470), Color(0.23, 0.23, 0.31), 7)
|
||||
draw_circle(Vector2(x + 8, 466), 13, Color(0.9, 0.45, 0.14, 0.45 + 0.1 * sin(t * 4 + i)))
|
||||
# Flechas de descenso y marco de piedra para el umbral.
|
||||
for i: int in range(3):
|
||||
var y: float = 770 + i * 120
|
||||
draw_colored_polygon(PackedVector2Array([Vector2(3150, y), Vector2(3220, y), Vector2(3185, y + 38)]), Color(0.75, 0.23, 0.42, 0.7))
|
||||
draw_rect(Rect2(3040, 470, 28, 240), Color(0.27, 0.22, 0.31))
|
||||
draw_rect(Rect2(3095, 470, 28, 240), Color(0.27, 0.22, 0.31))
|
||||
draw_rect(Rect2(3040, 445, 84, 32), Color(0.37, 0.27, 0.39))
|
||||
# Cripta: columnas, arco, luna ensangrentada y antorchas.
|
||||
draw_circle(Vector2(3790, 890), 64, Color(0.69, 0.18, 0.23, 0.35))
|
||||
for x: float in [3340.0, 3520.0, 4030.0, 4240.0]:
|
||||
draw_rect(Rect2(x, 965, 35, 305), Color(0.22, 0.18, 0.29))
|
||||
draw_rect(Rect2(x - 12, 953, 58, 22), Color(0.33, 0.25, 0.37))
|
||||
draw_rect(Rect2(x - 12, 1248, 58, 24), Color(0.33, 0.25, 0.37))
|
||||
draw_circle(Vector2(x + 18, 1030), 14, Color(0.95, 0.29, 0.30, 0.35 + 0.1 * sin(t * 5 + x)))
|
||||
draw_arc(Vector2(3780, 1040), 240, PI, TAU, 36, Color(0.36, 0.24, 0.42), 18)
|
||||
for x: int in range(3320, 4300, 110):
|
||||
draw_line(Vector2(x, 1259), Vector2(x + 40, 1249), Color(0.49, 0.29, 0.38, 0.55), 3)
|
||||
Reference in new issue
Block a user