Main.gd 794 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 minlat = 0
  7. var maxlat = 6
  8. var minlon = 0
  9. var maxlon = 3
  10. var curlat = 0
  11. var curlon = 0
  12. func _ready():
  13. curlat = minlat
  14. curlon = minlon
  15. func _process(delta):
  16. if curlat < maxlat:
  17. if curlon < maxlon:
  18. var moontile = tileGenScene.instance()
  19. moontile.init(curlat,curlon)
  20. #moontile.scale=Vector3(1000,1000,1000)
  21. $Tiles.add_child(moontile)
  22. .get_node("UI/3").text="LatLon=="+str(Common.latLonToGlobal(curlat,curlon))
  23. curlon += 1
  24. else:
  25. curlat +=1
  26. curlon = 0
  27. if curlat >= maxlat:
  28. print("loading complete")
  29. # Called every frame. 'delta' is the elapsed time since the previous frame.
  30. #func _process(delta):
  31. # pass