|
@@ -5,27 +5,24 @@ extends Spatial
|
|
# var a = 2
|
|
# var a = 2
|
|
# var b = "text"
|
|
# var b = "text"
|
|
#var tileGenScene = preload("res://TileGenerator.tscn")
|
|
#var tileGenScene = preload("res://TileGenerator.tscn")
|
|
-var Chunk = preload("res://chunk.tscn")
|
|
|
|
|
|
+#var Chunk = preload("res://chunk.tscn")
|
|
|
|
|
|
-var minlat = 20
|
|
|
|
-var maxlat = 26
|
|
|
|
-var minlon = 308
|
|
|
|
-var maxlon = 313
|
|
|
|
-var steplat = 1
|
|
|
|
-var steplon = 1
|
|
|
|
|
|
+#var minlat = 20
|
|
|
|
+#var maxlat = 26
|
|
|
|
+#var minlon = 308
|
|
|
|
+#var maxlon = 313
|
|
|
|
+#var steplat = 1
|
|
|
|
+#var steplon = 1
|
|
|
|
|
|
-var resolution = 512
|
|
|
|
|
|
+#var resolution = 512
|
|
var radius = 1737.4#*1000
|
|
var radius = 1737.4#*1000
|
|
-
|
|
|
|
var startPos = Vector3(20,308,radius)
|
|
var startPos = Vector3(20,308,radius)
|
|
|
|
|
|
-var curlat = 0
|
|
|
|
-var curlon = 0
|
|
|
|
|
|
+#var curlat = 0
|
|
|
|
+#var curlon = 0
|
|
|
|
|
|
func _ready():
|
|
func _ready():
|
|
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
|
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
|
- curlat = minlat*steplat
|
|
|
|
- curlon = minlon*steplon
|
|
|
|
get_node("Player").moveTo(startPos)
|
|
get_node("Player").moveTo(startPos)
|
|
|
|
|
|
func _input(event):
|
|
func _input(event):
|
|
@@ -37,22 +34,18 @@ func _input(event):
|
|
get_tree().set_input_as_handled()
|
|
get_tree().set_input_as_handled()
|
|
|
|
|
|
func _process(delta):
|
|
func _process(delta):
|
|
- if curlat < maxlat*steplat:
|
|
|
|
- if curlon < maxlon*steplon:
|
|
|
|
- call_deferred("add_chunk", curlon, curlat)
|
|
|
|
- curlon += steplon
|
|
|
|
- else:
|
|
|
|
- curlat +=steplat
|
|
|
|
- curlon = 0
|
|
|
|
- if curlat >= maxlat:
|
|
|
|
- print("loading complete")
|
|
|
|
-
|
|
|
|
-func add_chunk(curlon, curlat):
|
|
|
|
- var chunk = Chunk.instance()
|
|
|
|
- chunk.setParams(curlat,curlat+steplat,curlon,curlon+steplon,resolution,radius)
|
|
|
|
- #moontile.scale=Vector3(1000,1000,1000)
|
|
|
|
- $Chunks.add_child(chunk)
|
|
|
|
- .get_node("UI/3").text="lastLatLon="+str(curlat)+":"+str(curlon)
|
|
|
|
|
|
+ pass
|
|
|
|
+ #if curlat < maxlat*steplat:
|
|
|
|
+ # if curlon < maxlon*steplon:
|
|
|
|
+ # .get_node("Chunks").call_deferred("add_chunk", Vector2(curlat,curlon))
|
|
|
|
+ # curlon += steplon
|
|
|
|
+ # else:
|
|
|
|
+ # curlat +=steplat
|
|
|
|
+ # curlon = 0
|
|
|
|
+ # if curlat >= maxlat:
|
|
|
|
+ # print("loading complete")
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
#func _process(delta):
|
|
#func _process(delta):
|