Main.gd 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. extends Spatial
  2. # Declare member variables here. Examples:
  3. # var a = 2
  4. # var b = "text"
  5. #var tileGenScene = preload("res://TileGenerator.tscn")
  6. #var Chunk = preload("res://chunk.tscn")
  7. #var minlat = 20
  8. #var maxlat = 26
  9. #var minlon = 308
  10. #var maxlon = 313
  11. #var steplat = 1
  12. #var steplon = 1
  13. #var resolution = 512
  14. var radius = 1737.4*1000
  15. var startPos = Vector3(0,354,radius)
  16. #var curlat = 0
  17. #var curlon = 0
  18. func _ready():
  19. Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
  20. get_node("Player").moveTo(startPos)
  21. func _input(event):
  22. if event.is_action_pressed("ui_cancel"):
  23. Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
  24. if event.is_action_pressed("click"):
  25. if Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE:
  26. Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
  27. get_tree().set_input_as_handled()
  28. func _process(delta):
  29. pass
  30. #if curlat < maxlat*steplat:
  31. # if curlon < maxlon*steplon:
  32. # .get_node("Chunks").call_deferred("add_chunk", Vector2(curlat,curlon))
  33. # curlon += steplon
  34. # else:
  35. # curlat +=steplat
  36. # curlon = 0
  37. # if curlat >= maxlat:
  38. # print("loading complete")
  39. "background_sky_rotation_degrees"
  40. # Called every frame. 'delta' is the elapsed time since the previous frame.
  41. #func _process(delta):
  42. # pass