Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: jamesreg on Thu 31/12/2009 19:21:59

Title: INT Increasing by one on random
Post by: jamesreg on Thu 31/12/2009 19:21:59
I have several explosions that will injure the character if they touch the explosion area.
I have a INT set as CharacterHit set to 0

I need to as you come into contact with the explosions be able to tell the game to increase the INT by +1 each time your hit by an explosion.

How do I do that I know its a simple one line thing im sure.

I know if i wanted to set the number i would do CharacterHit = 2;

But I need it to be more random so i can keep track of the players health.

is there anything like CharacterHit + 1;

or something simular that would increase the number by one for me.

Title: Re: INT Increasing by one on random
Post by: on Thu 31/12/2009 19:25:51
Try

CharacterHit = CharacterHit + 1;
Title: Re: INT Increasing by one on random
Post by: Ryan Timothy B on Thu 31/12/2009 19:33:27
CharacterHit = CharacterHit + 1;

or

CharacterHit+=1;

or

CharacterHit++;



All three of these work and will add 1 to CharacterHit.