Advertisement
Nik333

RR lap tutorial

Sep 22nd, 2021
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. How to add checkpoints to RR map
  2.  
  3. Make a map using Nox's RR level editor
  4. Paste this in front of the generated code:
  5.  
  6. var infu=[];init=function(){for(var f in infu){infu[f]();}};infu.push(function(){extra.lap=0;extra.glap=0;extra.check=0;extra.gcheck=0;canwin=0;});var lapcount,checkcount;var mudcheckpoint=function(x,y,l,w,i){mud(x,y,l,w);if(extra.lap!==undefined&&extra.check===i&&collide(x,y,l,w)){extra.check++;if(extra.check>=checkcount){extra.check=0;extra.lap++;if(extra.lap>=lapcount){canwin=true;}}}if(extra.glap!==undefined&&extra.gcheck===i&&collide(x,y,l,w,true)){extra.gcheck++;if(extra.gcheck>=checkcount){extra.gcheck=0;extra.glap++;}}};
  7.  
  8.  
  9. Paste this. Change 4 to the number of checkpoints you want and 3 to the number of laps you want.
  10.  
  11. checkcount=4;lapcount=3;
  12.  
  13.  
  14. Now you need to add checkpoints! Paste codes like this. The numbers in brackets are X, Y, Width, Height, CheckpointID.
  15. CheckpointID of the first checkpoint is 0 and last is the number you put above instead of 4 minus 1 (so here it'd be number 0-3 inclusive). The player needs to pass checkpoints in this order for a lap to count. Upon completing the final lap, the goal (red square from the editor) is unlocked.
  16. mudcheckpoint(213,111,10,18,3);
  17.  
  18.  
  19. Paste this at the end of your code to show lap count. Edit 205,0 to change the coords.
  20.  
  21. text("Lap "+((extra.lap||0)+1)+"/"+lapcount,205,0);
  22.  
  23.  
  24. Finally, remove any newlines from the code you created. Congrats, you now have a level with laps.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement