37 lines
1.4 KiB
GDScript
37 lines
1.4 KiB
GDScript
extends Node2D
|
|
|
|
func _ready() -> void:
|
|
GameState.start_new_run()
|
|
RenderingServer.set_default_clear_color(Color("071420"))
|
|
var heading := Label.new()
|
|
heading.text = "POLE OCHRONNE · TARCZA STATKU"
|
|
heading.position = Vector2(90,65)
|
|
heading.add_theme_font_size_override("font_size",26)
|
|
add_child(heading)
|
|
for index in 3:
|
|
var ship := preload("res://scenes/game/player_ship.tscn").instantiate()
|
|
ship.get_node("Camera2D").enabled = false
|
|
add_child(ship)
|
|
ship.position = Vector2(260+index*380,350)
|
|
ship.scale = Vector2.ONE*1.8
|
|
ship.set_physics_process(false)
|
|
ship.get_node("WeaponController").set_physics_process(false)
|
|
var shield := ship.get_node("ShieldVisual")
|
|
shield.set_shield_values(20.0 if index == 1 else 100.0,100.0)
|
|
shield.set_process(false)
|
|
shield._time = 0.5
|
|
if index == 2:
|
|
shield.flash_hit(ship.global_position+Vector2(100,-80))
|
|
shield._hits[0].age = 0.06
|
|
var label := Label.new()
|
|
label.text = ["PEŁNE TARCZE","NISKA MOC OSŁONY","TRAFIENIE W POLE"][index]
|
|
label.position = ship.position+Vector2(-105,140)
|
|
label.add_theme_font_size_override("font_size",16)
|
|
label.modulate = Color("91dbea")
|
|
add_child(label)
|
|
for frame in 12: await get_tree().process_frame
|
|
await RenderingServer.frame_post_draw
|
|
assert(get_viewport().get_texture().get_image().save_png("res://artifacts/shield_polish.png") == OK)
|
|
print("SHIELD POLISH PREVIEW PASS: full/low shield and directional impact rendered")
|
|
get_tree().quit()
|