mirror of
https://github.com/Steffo99/pineapple-surf.git
synced 2024-11-21 23:34:21 +00:00
Spawn CropTile
s inside their container
This commit is contained in:
parent
04be345aba
commit
076fdb62c5
1 changed files with 4 additions and 2 deletions
|
@ -6,6 +6,8 @@ var last_fired := 0
|
||||||
var remaining := 10
|
var remaining := 10
|
||||||
|
|
||||||
@onready var ray = $RayCast3D
|
@onready var ray = $RayCast3D
|
||||||
|
# FIXME: use singleton class here as well
|
||||||
|
@onready var croptiles_container: Node3D = get_tree().root.find_child("CropTiles", true, false)
|
||||||
var croptile = preload("res://island/CropTile.tscn")
|
var croptile = preload("res://island/CropTile.tscn")
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +62,7 @@ func try_placing_seed(ray: RayCast3D) -> bool:
|
||||||
var correct_point = point.floor()
|
var correct_point = point.floor()
|
||||||
var crop = croptile.instantiate() as CropTile
|
var crop = croptile.instantiate() as CropTile
|
||||||
crop.position = correct_point
|
crop.position = correct_point
|
||||||
crop.debug_growth = true
|
croptiles_container.add_child(crop)
|
||||||
get_tree().root.add_child(crop)
|
crop.plant()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue