Randoloot/scripts/planets/specialist_house.gd
2026-10-20 19:53:03 +02:00

35 lines
1.3 KiB
GDScript

extends Sprite2D
# A recognizable inhabited home, distinct from abandoned surface structures.
func _ready() -> void:
texture = null
scale = Vector2.ONE
queue_redraw()
func _draw() -> void:
draw_ellipse_shadow()
draw_style_box(_walls(), Rect2(-39,-23,78,63))
draw_colored_polygon(PackedVector2Array([Vector2(-51,-21),Vector2(0,-62),Vector2(51,-21)]), Color("426b69"))
draw_polyline(PackedVector2Array([Vector2(-51,-21),Vector2(0,-62),Vector2(51,-21)]), Color("91b9ac"), 3, true)
draw_rect(Rect2(-10,6,20,34),Color("203c3c"))
draw_circle(Vector2(4,25),2,Color("eaca8a"))
for x in [-28,17]:
draw_rect(Rect2(x,-7,14,17),Color("f0d592"))
draw_line(Vector2(x+7,-7),Vector2(x+7,10),Color("526d62"),2)
draw_rect(Rect2(24,-56,9,24),Color("647a70"))
draw_line(Vector2(60,-15),Vector2(60,42),Color("7fada1"),3)
draw_colored_polygon(PackedVector2Array([Vector2(62,-15),Vector2(84,-8),Vector2(62,0)]),Color("a7e5a2"))
draw_circle(Vector2(60,-17),4,Color("b9f1b2"))
draw_rect(Rect2(-14,40,28,8),Color("778b7e"))
func _walls() -> StyleBoxFlat:
var style := StyleBoxFlat.new()
style.bg_color = Color("879685")
style.border_color = Color("364e47")
style.set_border_width_all(3)
return style
func draw_ellipse_shadow() -> void:
draw_set_transform(Vector2(7,40),0,Vector2(1,0.35))
draw_circle(Vector2.ZERO,60,Color(0.02,0.06,0.04,0.3))
draw_set_transform(Vector2.ZERO)