duncgibbs 99de9e8b40
Some checks failed
linting & formatting / build (push) Failing after 5s
itch.io publish action / build (linux64, x86_64) (push) Failing after 34s
itch.io publish action / build (osx, app) (push) Failing after 30s
itch.io publish action / build (win64, exe) (push) Failing after 31s
initial commit
2026-04-13 11:34:00 -05:00

51 lines
1.4 KiB
GDScript

extends Tile
var style_box: StyleBoxFlat
var walls: Array[Board.Direction] = []
func _ready() -> void:
style_box = get_theme_stylebox("panel")
func set_wall(direction: Board.Direction) -> void:
walls = [direction]
match direction:
Board.Direction.NONE:
walls = []
style_box.border_width_top = 0
style_box.border_width_bottom = 0
style_box.border_width_right = 0
style_box.border_width_left = 0
Board.Direction.UP:
style_box.border_width_top = 10
style_box.border_width_bottom = 0
style_box.border_width_right = 0
style_box.border_width_left = 0
Board.Direction.DOWN:
style_box.border_width_top = 0
style_box.border_width_bottom = 10
style_box.border_width_right = 0
style_box.border_width_left = 0
Board.Direction.RIGHT:
style_box.border_width_top = 0
style_box.border_width_bottom = 0
style_box.border_width_right = 10
style_box.border_width_left = 0
Board.Direction.LEFT:
style_box.border_width_top = 0
style_box.border_width_bottom = 0
style_box.border_width_right = 0
style_box.border_width_left = 10
func add_wall(direction: Board.Direction) -> void:
if !walls.has(direction):
walls.push_back(direction)
match direction:
Board.Direction.UP:
style_box.border_width_top = 10
Board.Direction.DOWN:
style_box.border_width_bottom = 10
Board.Direction.RIGHT:
style_box.border_width_right = 10
Board.Direction.LEFT:
style_box.border_width_left = 10