Variable, Things, Questions

Non-platform specific questions.

Variable, Things, Questions

Postby Caaz Games » Sun May 20, 2007 11:07 am

if I make a variable And Wanted to use it like a XP Bar like
Code: Select all
if(MyVariable == 500)
{
      LevelUp = 2;
}
Im Not So Sure How To Use It Or Any Thing So Can You People Help Me???

Also I Need To Know How To Place The Green Square Thingys In Sid Of Filled Reigens But Sort of Spread Out.
You are welcome to join my forum. 4 active members lol but it's a cool place. active... much talking :D it's fun!
http://caaz.freeforums.org/
User avatar
Caaz Games
 
Posts: 729
Joined: Wed Feb 14, 2007 9:09 am
Location: California....knows how to party!
Score: 25 Give a positive score

Postby dimster » Sun May 20, 2007 11:54 am

wouldnt it be:
Code: Select all
if(MyVariable >= 500)
{
      LevelUp = 2;
}


that might work... not sure though
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby Sgt. Sparky » Sun May 20, 2007 1:41 pm

both should work,
but if you want to make it with different levels
use,
Code: Select all
if(myvariable >= 500)
{
    LevelUP = 2;
}
if(myvariable >= 1000)
{
    LevelUP = 3;
}r
if(myvariable >= 1500)
{
    LevelUP = 4;
}
//ect.

with the higher number continuing further on. :D
(I just use a variable called requred,
and when my variable(EXP) is greater than or equal to required( >= )
oi, well here is an example.
Code: Select all
if(EXP >= required)
{
    if(required == 0)required = 500;
    else required *= 2;
    Level++;
}

:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest