Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: computerbynar on Sun 16/05/2004 22:01:51

Title: counters
Post by: computerbynar on Sun 16/05/2004 22:01:51
can i make counters, such as scores, life points, health,etc. How? And how do i have it be added to or subtracted from?
Title: Re: counters
Post by: Scorpiorus on Sun 16/05/2004 23:04:42
This can be achieved by making a use of variables. Check out the AGS Beginner's FAQ (http://www.rain-day.com/harbinger/faq/)

Example:

// main global script

int score = 0;
int life_points = 10;
int health = 100;


to add or substract:

score = score + 5; // will add 5 to score

health = health - 10; // will subtract 10 from health
Title: Re: counters
Post by: TerranRich on Tue 18/05/2004 04:51:16
Yes, please do check the BFAQ.