Add scaling Alien Grunt boss waves and native simulation; publish Web release
This commit is contained in:
@@ -9,6 +9,9 @@ var wave_value: Label
|
||||
var grenade_value: Label
|
||||
var help: Label
|
||||
var root: Control
|
||||
var boss_panel: VBoxContainer
|
||||
var boss_name: Label
|
||||
var boss_health: ProgressBar
|
||||
|
||||
func _ready() -> void:
|
||||
layer = 2
|
||||
@@ -44,6 +47,31 @@ func _ready() -> void:
|
||||
help.offset_right = 420
|
||||
help.offset_top = -30
|
||||
help.offset_bottom = -8
|
||||
boss_panel = VBoxContainer.new()
|
||||
boss_panel.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
root.add_child(boss_panel)
|
||||
boss_panel.set_anchors_and_offsets_preset(Control.PRESET_CENTER_TOP)
|
||||
boss_panel.offset_left = -180
|
||||
boss_panel.offset_right = 180
|
||||
boss_panel.offset_top = 76
|
||||
boss_name = _label(boss_panel, "ALIEN GRUNT", 17, Vector2.ZERO)
|
||||
boss_name.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
boss_health = ProgressBar.new()
|
||||
boss_health.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
boss_health.custom_minimum_size = Vector2(360, 18)
|
||||
boss_health.show_percentage = false
|
||||
boss_health.step = 0.0 # explosion falloff produces fractional health values
|
||||
boss_health.rounded = false
|
||||
var fill := StyleBoxFlat.new()
|
||||
fill.bg_color = Color(0.14, 0.85, 0.5)
|
||||
boss_health.add_theme_stylebox_override("fill", fill)
|
||||
var background := StyleBoxFlat.new()
|
||||
background.bg_color = Color(0.02, 0.05, 0.03, 0.9)
|
||||
background.border_color = AMBER
|
||||
background.set_border_width_all(1)
|
||||
boss_health.add_theme_stylebox_override("background", background)
|
||||
boss_panel.add_child(boss_health)
|
||||
boss_panel.hide()
|
||||
|
||||
func _panel(label: String, right: bool) -> Panel:
|
||||
var panel := Panel.new()
|
||||
@@ -76,6 +104,15 @@ func _label(parent: Control, text: String, size: int, pos: Vector2) -> Label:
|
||||
parent.add_child(label)
|
||||
return label
|
||||
|
||||
func update_boss(boss: Node) -> void:
|
||||
boss_panel.visible = is_instance_valid(boss) and not boss.dead
|
||||
if not boss_panel.visible:
|
||||
return
|
||||
boss_name.text = "ALIEN GRUNT — GRADO %d%s" % [boss.rank,
|
||||
" — ARRIVO" if boss.entering else " | %d / %d" % [ceili(boss.hp), ceili(boss.max_hp)]]
|
||||
boss_health.max_value = boss.max_hp
|
||||
boss_health.value = boss.hp
|
||||
|
||||
func update_status(player: Node, wave: int, score: int) -> void:
|
||||
health_value.text = str(maxi(0, ceili(player.hp)))
|
||||
health_value.add_theme_color_override("font_color", DANGER if player.hp <= 25 else AMBER)
|
||||
|
||||
Reference in New Issue
Block a user