School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 308,426 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 3,250 people online right now. Registration is fast and FREE... Join Now!




Coding help needed. Level Restrictions

 

Coding help needed. Level Restrictions, Leveling issue with my game

pendingkill

17 Jun, 2009 - 10:28 AM
Post #1

New D.I.C Head
*

Joined: 17 Jun, 2009
Posts: 2

CODE
//level 2 - 500

//level 3 - 1500

//level 4 - 3500

//level 5 - 6000






function experience($L) {

  $a=0;

  $end=0;

  for($x=1; $x<$L; $x++) {

    $a += floor($x+1500*pow(4, ($x/7)));

  }

  return floor($a/4);

}



function Get_The_Level($exp) {

  $a=0;

  $end =0;

  for($x=1; ($end==0 && $x<100); $x++) {

    $a += floor($x+1500*pow(4, ($x/7)));

    if ($exp >= floor($a/4)){

    } else {
    
      return $x;

      $end=1;

    }

  }

}



function Get_Max_Exp($L){

$end=0;

if ($exp == 0){

    return 457;

    $end =1;

  }

    for($L=1;($L<100 && $end==0);$L++) {

      $exp = experience($L);

      //echo $exp;

      if ($exp >= $user_class->exp){

        return $exp;

        $end=1;

      }

    }

}



Now for the questions... I have been beta testing this game to make sure all the kinks are out of the game however noticed it is impossible to change the exp needed to level. I have tried to change some the the code to get it to work and it did not.. What am I doing wrong here?

I have been trying to get help from my college professor as well and quite frankly im up shits creek I think..

Thanks in advance.

pK


Attached File(s)
Attached File  EXP.txt ( 774bytes ) Number of downloads: 14

User is offlineProfile CardPM
+Quote Post



Fast ReplyReply to this topicStart new topic

Time is now: 11/24/09 01:43PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month