Map generation fully working
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
extends Node
|
||||
|
||||
@onready var _Map = $Map
|
||||
@onready var _Map: Node = $Map
|
||||
#@onready var _Player = $Player
|
||||
#@onready var _Camera = $WorldCamera
|
||||
|
||||
@export var mapSize: int = 15
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
_Map.populate_terrain($CameraController.global_position)
|
||||
var thread: Thread = Thread.new()
|
||||
thread.start(func(): _Map.generate_map(mapSize))
|
||||
thread.wait_to_finish()
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
[node name="Main" type="Node"]
|
||||
script = ExtResource("1_qw60k")
|
||||
mapSize = 100
|
||||
|
||||
[node name="Map" parent="." instance=ExtResource("1_1r6ip")]
|
||||
|
||||
@@ -22,3 +23,5 @@ metadata/_custom_type_script = "uid://xrddv2epi3ty"
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="CameraController"]
|
||||
texture = ExtResource("5_2a143")
|
||||
|
||||
[editable path="Map"]
|
||||
|
||||
Reference in New Issue
Block a user