RingOfRaces/MiscCodes/Menu.gd

30 lines
896 B
GDScript3
Raw Normal View History

extends Node2D
func _ready():
pass # Replace with function body.
func _on_Btn_PlayGame_pressed():
# Global.LoadSave()
# Global.GoToScene("river_intersection_home_2")
2021-05-26 20:02:51 +00:00
2021-04-23 20:16:43 +00:00
Global.LoadSave()
2021-05-26 20:02:51 +00:00
#create gamemap on the fly
2021-04-23 20:16:43 +00:00
var game_data = GlobalStructures.base_tilemap.new()
var map_data = [[]]
for x in range(150):
map_data.append([])
for y in range(150):
2021-05-26 20:02:51 +00:00
map_data[x].append(int(rand_range(0, 3)))
2021-04-23 20:16:43 +00:00
game_data.init_map(150, 150, "res://omgeving/Floor.tres",map_data, "res://omgeving/Floor.tres", map_data, "res://omgeving/Floor.tres", map_data, "res://omgeving/Floor.tres", map_data)
var game = load("res://base_tilemap/base_tilemap.tscn").instance()
game.load_scene(game_data)
#set this scene as main
Global.mainscene = "startmap1"
2021-05-26 20:02:51 +00:00
Global.AddScene(game, "startmap1", true)
# get_tree().get_root().add_child(game)
2021-04-15 20:14:31 +00:00
func _on_Btn_LoadGame_pressed():
Global.GoToScene("loadgame_screen")