42 lines
1.5 KiB
GDScript
42 lines
1.5 KiB
GDScript
extends Control
|
|
|
|
var texts = [
|
|
"Hi there !",
|
|
"Welcome to MJ 166 b, it was a nice and hospitable exoplanet, but the humans settled in and ruined this place.",
|
|
"Now nothing grows, and the animals won't show up !",
|
|
"You got to help me with this, I prepared a lot of seeds, you just have to click and I'll plant.",
|
|
"The problem is that the place is quite inhospitable, each plant needs a special amount of water, a certain quality of ground (the fertility), and more or less space (population).",
|
|
"You have to place these plants in a special order, like the little ones first, for example.",
|
|
"The trees at the corner of the map are where the animals are hiding, it need a certain amount of vegetation around them to go out.",
|
|
"You can move on the map with the arrows (maj for maximal speed!), or you can click and grab with the mouse middle button.",
|
|
"Take advantage of the scanners at the top of the screen if you're lost.",
|
|
"Oh, I almost forgot, you can skip a seed with the right click if you want!",
|
|
"Let's help those animals!",
|
|
]
|
|
|
|
var win_text = "Thank you ! I think all the animals are out now... But I'd be happy to continue to plant with you !"
|
|
|
|
var cursor = 0
|
|
|
|
func _ready():
|
|
next_text()
|
|
show()
|
|
$RobotSpeak.playing = true
|
|
|
|
func _input(event):
|
|
if event.is_action_pressed("plant"):
|
|
next_text()
|
|
|
|
func win():
|
|
show()
|
|
$MarginContainer/Controls.hide()
|
|
$RobotSpeak.playing = true
|
|
$MarginContainer/Text.text = win_text
|
|
|
|
func next_text():
|
|
if cursor >= len(texts):
|
|
hide()
|
|
else:
|
|
$MarginContainer/Text.text = texts[cursor]
|
|
cursor += 1
|