default.nut 1.0 KB

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