2021-09-08 21:19:32 +00:00
|
|
|
extends Spatial
|
|
|
|
|
|
|
|
|
|
|
|
# Declare member variables here. Examples:
|
|
|
|
# var a = 2
|
|
|
|
# var b = "text"
|
|
|
|
|
|
|
|
# var list_creature = []
|
|
|
|
|
|
|
|
|
|
|
|
func add_creature(name:String, model:String, position:Vector3, orientation:Vector3):
|
|
|
|
var creature:Spatial = load( model ).instance()
|
|
|
|
creature.set_name(name)
|
|
|
|
creature.set_rotation(orientation)
|
|
|
|
creature.set_translation(position)
|
|
|
|
# list_creature.push_back(creature)
|
|
|
|
$creatures.add_child(creature)
|
|
|
|
|
|
|
|
|
|
|
|
func move_creature(name, model, posx, posy, posz):
|
|
|
|
var position:Vector3 = Vector3( posx, posy, posz )
|
|
|
|
if $creatures.has_node(name):
|
|
|
|
var creature:Spatial = $creatures.get_node(name)
|
|
|
|
var pos : Vector3 = $creature.get_global_transform().origin
|
|
|
|
# $creatures.get_node(name).get_
|
|
|
|
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
|
|
|
var current: Vector3 = Vector3( 0.0, 0.0, 0.0 )
|
2021-09-22 22:50:40 +00:00
|
|
|
$player.connect("menu_options_pressed", self, "_on_menu_options")
|
|
|
|
|
|
|
|
|
|
|
|
func _on_menu_options():
|
|
|
|
Config.msg_info("Received menu options")
|
|
|
|
if $menu_options.is_visible():
|
|
|
|
$menu_options.hide()
|
|
|
|
else:
|
|
|
|
$menu_options.show()
|
2021-09-08 21:19:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
|
|
func _process(delta):
|
2021-09-22 22:50:40 +00:00
|
|
|
#Config.msg_info("update Map")
|
2021-09-08 21:19:32 +00:00
|
|
|
pass
|