underground.nut 551 B

123456789101112131415161718
  1. if(! ("underground" in state)){
  2. state.underground <- false;
  3. print("[DEBUG] Underground state initialized\n");
  4. }
  5. function go_underground(under){
  6. fade_time <- 0.35;
  7. Underground_cover.fade(under ? 0 : 1, fade_time);
  8. Land_foreground_1.fade(under ? 0 : 1, fade_time);
  9. Land_foreground_2.fade(under ? 0 : 1, fade_time);
  10. Land_foreground_3.fade(under ? 0 : 1, fade_time);
  11. Underground_mask.fade(under ? 1 : 0, fade_time);
  12. Underground_darkness.fade(under ? 1 : 0, fade_time);
  13. state.underground <- under;
  14. }
  15. go_underground(state.underground);