• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Help with globals(clicker game)

F

Ferre

Guest
So i'm starting to create a clicking game.
It consists in killing monsters.
So my click damage is
Code:
{
global.clickdamage = 1 + global.strength;
}
When I try to add strength, I have a button that adds 1 strength. I click it and it adds strength but the click damage doesn't update, what can I do?

I tried adding a step event with the same global above but when I try to multiply the global it doesn't work so I went back and asked for help...

Sorry if my english is bad, I speak spanish :s

Waiting for help... thanks!
 

XanthorXIII

Member
We probably need a little more information such as the code that you are using when you click on the critter to hit it. That might give us an idea of what the issue is. I'm not sure as to how familiar you are with GM. I would look for some tutorials on it, and also hit the manual for information. Treasure Trove of information in there.
 
F

Ferre

Guest
I'm just getting starter with GM. I saw a lot of different tutorials...
This is the code that I use for the button that adds +1 strength. It adds strength but the click damage doesn't update :/
Code:
{
if(global.leveluppoints>0)
{
global.strength+=1
global.leveluppoints-=1
}
else
{

}
}
 

NightFrost

Member
You need to update global.clickdamage. It will not automatically recalculate itself when global.strength gets changed.
 
F

Ferre

Guest
When you update global.strength, add another line that recalculates your global.clickdamage variable - basically the same line of code in your OP.
I did that and it worked! Thanks a lot guys :)
 
Top