default.nut 673 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * This script gets loaded into the squirrel root vm in supertux. So functions
  3. * and variables you define here can be used in all threads
  4. */
  5. //Create Level table
  6. Level <- {
  7. finish=Level_finish,
  8. spawn=Level_spawn,
  9. flip_vertically=Level_flip_vertically,
  10. toggle_pause=Level_toggle_pause,
  11. edit=Level_edit
  12. };
  13. function end_level()
  14. {
  15. play_music("music/leveldone.ogg");
  16. Tux.deactivate();
  17. wait(6);
  18. Effect.fade_out(2);
  19. wait(2);
  20. Level.finish(true);
  21. }
  22. function levelflip()
  23. {
  24. Effect.fade_out(1);
  25. wait(1);
  26. Level.flip_vertically();
  27. Effect.fade_in(1);
  28. }
  29. function println(val)
  30. {
  31. print(val);
  32. print("\n");
  33. }
  34. if(! ("state" in this))
  35. state <- {};