untitled-plant-game/World/Pixel.gd

23 lines
386 B
GDScript3
Raw Normal View History

2021-12-04 00:20:48 +00:00
extends ColorRect
2021-12-04 15:14:06 +00:00
var active = false
2021-12-04 00:20:48 +00:00
var position = Vector2()
2021-12-04 15:14:06 +00:00
var age = 0
2021-12-04 00:20:48 +00:00
2021-12-04 15:14:06 +00:00
export var colors = [
2021-12-04 16:45:59 +00:00
Color("#00ffffff"), #seethrough
Color("#beed84"), #green
Color("#91e369"),
2021-12-04 15:14:06 +00:00
Color("#56c157"),
Color("#46a65c"),
2021-12-04 16:45:59 +00:00
Color("#358859")
]
2021-12-04 15:14:06 +00:00
func age_up():
2021-12-04 16:45:59 +00:00
if !(age >= colors.size() - 1):
2021-12-04 15:14:06 +00:00
age += 1
color = colors[age]
active = true
func _ready() -> void:
color = colors[age]