diff options
Diffstat (limited to 'scripts/base.gd')
| -rw-r--r-- | scripts/base.gd | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/scripts/base.gd b/scripts/base.gd index f89eedc..3d138d9 100644 --- a/scripts/base.gd +++ b/scripts/base.gd @@ -35,7 +35,31 @@ func _input(event): self.cam.translate(Vector3(0,-0.1,0)) if event.scancode == KEY_W: self.cam.translate(Vector3(0,0.1,0)) - if event.scancode == KEY_H: - var s = self.cam.get_selected() - if s != null: - get_node("Incubator").push_world(s)
\ No newline at end of file + + if event.is_pressed(): + if event.scancode == KEY_H: + var s = self.cam.get_selected() + if s != null: + get_node("Incubator").push_world(s) + if event.scancode == KEY_N: + var w = Wrld.instance() + w.set_scale(Vector3(0.02, 0.02, 0.02)) + add_child(w) + get_node("Incubator").push_world(w) + if event.scancode == KEY_Q: + var w = get_node("World") + if w != null: + var pos = get_node("cmb2inc") + w.set_translation(Vector3(0,0,0)) + remove_child(w) + pos.add_child(w) + get_node("AnimationPlayer").play("cmb2inc") + + +func _on_AnimationPlayer_animation_finished( name ): + if name == "cmb2inc": + var w = get_node("cmb2inc/World") + var pos = get_node("cmb2inc") + pos.remove_child(w) + add_child(w) + w.set_translation(pos.get_translation()) |
