1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- extends Spatial
- # Declare member variables here. Examples:
- # var a = 2
- # var b = "text"
- #var tileGenScene = preload("res://TileGenerator.tscn")
- var Chunk = preload("res://chunk.tscn")
- var minlat = -90
- var maxlat = 90
- var minlon = 0
- var maxlon = 360
- var steplat = 1
- var steplon = 1
- var resolution = 10
- var radius = 20
- var curlat = 0
- var curlon = 0
- func _ready():
- Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
- curlat = minlat*steplat
- curlon = minlon*steplon
-
- func _input(event):
- if event.is_action_pressed("ui_cancel"):
- Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
- if event.is_action_pressed("click"):
- if Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE:
- Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
- get_tree().set_input_as_handled()
- func _process(delta):
- if curlat < maxlat*steplat:
- if curlon < maxlon*steplon:
- var chunk = Chunk.instance()
- chunk.setParams(curlat,curlat+steplat,curlon,curlon+steplon,resolution,radius)
- #moontile.scale=Vector3(1000,1000,1000)
- $Tiles.add_child(chunk)
- .get_node("UI/3").text="lastLatLon="+str(curlat)+":"+str(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.
- #func _process(delta):
- # pass
|