class_name Tile extends Sprite2D var biteSprite := preload("res://pacbiite.png") var powerSprite := preload("res://pacpower.png") var hasBite: bool: set (val): hasBite = val updateMe() var hasPower: bool: set (val): hasPower = val updateMe() var isWall: bool: set (val): isWall = val updateMe() var isPacmanIntersection: bool: set (val): isPacmanIntersection = val updateMe() var isGhostIntersection: bool: set (val): isGhostIntersection = val updateMe() func _init(hb:bool, hp:bool, wall:bool, pint:bool, gint:bool): hasBite = hb hasPower = hp isWall = wall isPacmanIntersection = pint isGhostIntersection = gint func updateMe(): if hasBite: texture = biteSprite elif (!hasBite): texture = Texture2D.new() if hasPower: texture = powerSprite elif (!hasPower && !hasBite): texture = Texture2D.new()