mejoras en jugabilidad
This commit is contained in:
1 parent
d983bc2e69
commit
ec7e35ddf6
40 files changed
+856
-538
No files matched your search
@@ -1,63 +0,0 @@
|
||||
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: OssuaryGateVisual = $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)
|
||||
gate_visual.fully_open.connect(_on_gate_fully_opened)
|
||||
$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_visual.set_unlocked(_gate_open)
|
||||
if not _gate_open:
|
||||
gate_shape.set_deferred("disabled", false)
|
||||
if _gate_open:
|
||||
notice.text = "TODOS DERROTADOS. EL SELLO SE HA ROTO."
|
||||
else:
|
||||
notice.text = LOCKED_TEXT
|
||||
|
||||
func _on_gate_fully_opened() -> void:
|
||||
# La colision no desaparece hasta terminar de abrirse visualmente.
|
||||
gate_shape.set_deferred("disabled", true)
|
||||
|
||||
|
||||
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()
|
||||
+9
-42
@@ -1,8 +1,9 @@
|
||||
[gd_scene load_steps=16 format=3]
|
||||
[gd_scene load_steps=15 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://levels/level_02.gd" id="level"]
|
||||
[ext_resource type="Script" path="res://levels/level_root.gd" id="level"]
|
||||
[ext_resource type="Script" path="res://levels/level_02_art.gd" id="art"]
|
||||
[ext_resource type="Script" path="res://world/triggers/ossuary_gate_visual.gd" id="gate_art"]
|
||||
[ext_resource type="PackedScene" path="res://world/triggers/kill_gate.tscn" id="gate"]
|
||||
[ext_resource type="PackedScene" path="res://world/triggers/boss_victory.tscn" id="boss_victory"]
|
||||
[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"]
|
||||
@@ -14,12 +15,6 @@
|
||||
[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)
|
||||
@@ -153,40 +148,12 @@ aggro_range = 195.0
|
||||
[node name="Boss" parent="." instance=ExtResource("boss")]
|
||||
position = Vector2(3840, 1150)
|
||||
|
||||
[node name="Gate" type="StaticBody2D" parent="."]
|
||||
[node name="Gate" parent="." instance=ExtResource("gate")]
|
||||
position = Vector2(3070, 600)
|
||||
collision_layer = 1
|
||||
collision_mask = 0
|
||||
enemies_root_path = NodePath("../Enemies")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Gate"]
|
||||
shape = SubResource("gate_collision")
|
||||
|
||||
[node name="Visual" type="Node2D" parent="Gate"]
|
||||
script = ExtResource("gate_art")
|
||||
|
||||
[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="BossVictory" parent="." instance=ExtResource("boss_victory")]
|
||||
boss_path = NodePath("../Boss")
|
||||
victory_message = "LA MUERTE ESPECTRAL HA CAIDO"
|
||||
|
||||
[node name="MobileControls" parent="." instance=ExtResource("mobile")]
|
||||
@@ -184,6 +184,10 @@ func _get_configuration_warnings() -> PackedStringArray:
|
||||
var warnings := PackedStringArray()
|
||||
if not has_node("Player"):
|
||||
warnings.append("Falta Player. Arrastra player/player.tscn y conserva ese nombre en la raiz del nivel.")
|
||||
else:
|
||||
var player: Node2D = get_node_or_null("Player") as Node2D
|
||||
if player != null and not camera_bounds.has_point(player.position):
|
||||
warnings.append("Player comienza fuera de Camera Bounds; revisa su posicion o el rectangulo.")
|
||||
if not scale.is_equal_approx(Vector2.ONE) or not is_zero_approx(rotation):
|
||||
warnings.append("No escales ni rotes la raiz del nivel; edita las piezas individualmente.")
|
||||
for reward: RareItemData in completion_rewards:
|
||||
|
||||
Reference in new issue
Block a user