default.nut 752 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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/misc/leveldone.ogg");
  16. Tux.deactivate();
  17. wait(6);
  18. Effect.fade_out(2);
  19. wait(2);
  20. Level.finish(true);
  21. }
  22. function exit_worldmap()
  23. {
  24. wait_for_screenswitch();
  25. exit_screen();
  26. }
  27. function levelflip()
  28. {
  29. Effect.fade_out(1);
  30. wait(1);
  31. Level.flip_vertically();
  32. Effect.fade_in(1);
  33. }
  34. function println(val)
  35. {
  36. print(val);
  37. print("\n");
  38. }
  39. if(! ("state" in this))
  40. state <- {};