ItsMods

Full Version: switch(RandomInt(9)) Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
instead of random 0 - 9 how do i make it like switch 1 2 3 4 5 6 to 9 then 0 back
Code:
level.superSwitch = 0;

function doMagic() {
  switch(level.superSwitch) {
    case 0:
    case 1:
    ...
    case 9:
  }
  level.superSwitch++;
}
(03-27-2011, 15:45)SuperNovaAO Wrote: [ -> ]
Code:
level.superSwitch = 0;

function doMagic() {
  switch(level.superSwitch) {
    case 0:
    case 1:
    ...
    case 9:
  }
  level.superSwitch++;
  if(level.superSwitch==10)
          level.superSwitch=0;
}

Fixed Wink
Yeah, forgot.