| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 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()
|