default.nut 916 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. set_start_point=Level_set_start_point,
  10. set_start_pos=Level_set_start_pos,
  11. set_respawn_point=Level_set_respawn_point,
  12. set_respawn_pos=Level_set_respawn_pos,
  13. flip_vertically=Level_flip_vertically,
  14. toggle_pause=Level_toggle_pause,
  15. edit=Level_edit
  16. };
  17. function end_level()
  18. {
  19. play_music("music/misc/leveldone.ogg");
  20. Tux.deactivate();
  21. wait(6);
  22. Effect.fade_out(2);
  23. wait(2);
  24. Level.finish(true);
  25. }
  26. function exit_worldmap()
  27. {
  28. wait_for_screenswitch();
  29. exit_screen();
  30. }
  31. function levelflip()
  32. {
  33. Effect.fade_out(1);
  34. wait(1);
  35. Level.flip_vertically();
  36. Effect.fade_in(1);
  37. }
  38. function println(val)
  39. {
  40. print(val);
  41. print("\n");
  42. }
  43. if(! ("state" in this))
  44. state <- {};