default.nut 577 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. function end_level()
  6. {
  7. play_music("music/misc/leveldone.ogg");
  8. Tux.deactivate();
  9. wait(6);
  10. Effect.fade_out(2);
  11. wait(2);
  12. Level.finish(true);
  13. }
  14. function exit_worldmap()
  15. {
  16. wait_for_screenswitch();
  17. exit_screen();
  18. }
  19. function levelflip()
  20. {
  21. Effect.fade_out(1);
  22. wait(1);
  23. Level.flip_vertically();
  24. Effect.fade_in(1);
  25. }
  26. function println(val)
  27. {
  28. print(val);
  29. print("\n");
  30. }
  31. if(! ("state" in this))
  32. state <- {};