Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Bool dosent work, like i want to.!

Author
Message
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 31st Dec 2008 23:46
god, i am trying to make a menu for my game but when i try to create a link(not shure how to say"when you click on the options button"that you woud go to options)
i try this
[/code]
bool Menu1=true;
bool Menu2=false;
if(Menu1=true)
{

dbSprite (1, 0,0, 1);
dbSizeSprite( 1, (dbScreenWidth()),(dbScreenHeight()));

//buutons
//exit

if ( dbMouseX ( ) > 480 && dbMouseX ( ) < 547 && dbMouseY ( ) > 690 && dbMouseY ( ) <730&&dbMouseClick() )
{
return;
}
//options
if ( dbMouseX ( ) > 450 && dbMouseX ( ) < 450+120 && dbMouseY ( ) > 653 && dbMouseY ( ) <693&&dbMouseClick() )
{
Menu1=false;
Menu2=true;
}


}




if(Menu2=true)
{
dbSprite(2, 0,0, 2);
dbSizeSprite(0, (dbScreenWidth()), (dbScreenHeight())
}
dbSync ( );
}

return;
}

[code]
but the little red sprite shows up allredy on start up it should only on the click off options(picture in the filles)

Game.Love
Sharp Bullet
16
Years of Service
User Offline
Joined: 5th Feb 2008
Location: Pluto
Posted: 1st Jan 2009 01:19
<Bool> is working, but I see a mistake when you try ro verify

if(Menu1=true)
if(Menu2=true)

there should be

if(Menu1==true)
if(Menu2==true)


This is C++ !

First say to yourself what you would be; and then do what you have to do.
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 1st Jan 2009 05:18
To expand on what Sharp Bullet said, '=' is an assignment operator, used to assign values to variables, while '==' is a comparison operator used to check if two variables have the same value.


FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 1st Jan 2009 10:23
Works now, thnx man...
i new it was something stupid like this

Game.Love
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 1st Jan 2009 11:21
Or, you could just do "if(Menu1)" or "if(!Menu1)" which is easier to type

Login to post a reply

Server time is: 2024-11-25 09:20:59
Your offset time is: 2024-11-25 09:20:59