CUBE.gd 363 B

12345678910111213141516171819202122232425
  1. extends Chattable
  2. var freq = 0.5
  3. var phase = 0
  4. var active = true
  5. var amplitude = 0.1
  6. func _process(delta):
  7. if active:
  8. $Spatial.translation = Vector3(0,amplitude*sin(phase),0)
  9. phase=wrapf(phase+delta*6.28*freq,0,6.28)
  10. func init_():
  11. return [
  12. Saying.new(Saying.ITSELF, "ok","reset_"),
  13. ]
  14. func reset_():
  15. get_tree().change_scene("res://Main.tscn")