Jump to content

just quick help...


seany123

Recommended Posts

i am making a game and in this battle page i have to write how much exp the winner of a fight gains... which is this...

 

$exploss1 = ($player->level - $enemy->level);

 

but can anyone show me how to make it so the maximun is 10,000??

 

im not quite sure how to do it..

 

something like...

 

$exploss1 = ($player->level - $enemy->level < 10000);

Link to comment
Share on other sites

The syntax of if is:

 

if(condition)

    statement

 

 

{} essentially groups multiple statements into 1 such that the code inside the {} block is viewed as one statement (logically, not executionally).

 

 

So, no they are not needed if only 1 statement is to be executed.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.