ghostforest.nut 980 B

12345678910111213141516171819202122232425262728
  1. if(! ("ghostforest" in state)){
  2. state.ghostforest <- false;
  3. print("[DEBUG] Ghost Forest state initialized\n");
  4. }
  5. function go_ghostforest(under){
  6. fade_time <- 0.35;
  7. ghost_darkness.fade(under ? 1 : 0, fade_time);
  8. ghost_land.fade(under ? 1 : 0, fade_time);
  9. ghost_convex.fade(under ? 1 : 0, fade_time);
  10. ghost_edges.fade(under ? 1 : 0, fade_time);
  11. ghost_back.fade(under ? 1 : 0, fade_time);
  12. ghost_front.fade(under ? 1 : 0, fade_time);
  13. ghost_trees0.fade(under ? 1 : 0, fade_time);
  14. ghost_trees1.fade(under ? 1 : 0, fade_time);
  15. ghost_trees2.fade(under ? 1 : 0, fade_time);
  16. ghost_trees3.fade(under ? 1 : 0, fade_time);
  17. ghost_trees4.fade(under ? 1 : 0, fade_time);
  18. land_trees1.fade(under ? 0 : 1, fade_time);
  19. land_trees2.fade(under ? 0 : 1, fade_time);
  20. land_trees3.fade(under ? 0 : 1, fade_time);
  21. land_trees4.fade(under ? 0 : 1, fade_time);
  22. back_trees.fade(under ? 0 : 1, fade_time);
  23. state.ghostforest <- under;
  24. }
  25. go_ghostforest(state.ghostforest);