khanat-client/scenes/game/alpha.gd

45 lines
1.2 KiB
GDScript3

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 )
$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()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
#Config.msg_info("update Map")
pass