Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualBrother Bob

Posted 17 February 2012 - 05:41 PM

No. You have an array with 99 element, and the index 99 refers to the 100th element. It is outside the array, so it's not a valid array element.

But ignoring that; yes, the logic is otherwise OK, as long as you index the array properly. You probably want this instead though:

if(exp>=exptilnextlevel[level])

{

++level;

}


#2Brother Bob

Posted 17 February 2012 - 05:40 PM

No. You have an array with 99 element, and the index 99 refers to the 100th element. It is outside the array, so it's not a valid array element.

But ignoring that; yes, the logic is otherwise OK, as long as you index the array properly. You probably want this instead:

if(exp>=exptilnextlevel[level])

{

++level;

}


#1Brother Bob

Posted 17 February 2012 - 05:40 PM

No. If you have an array with 99 element, and the index 99 refers to the 100th element. It is outside the array, so it's not a valid array element.

But ignoring that; yes, the logic is otherwise OK, as long as you index the array properly. You probably want this instead:

if(exp>=exptilnextlevel[level])

{

++level;

}


PARTNERS