Page 1 of 1

score problems

PostPosted: Sat May 26, 2007 4:12 pm
by dimster
ok, i am making a 2 - 4 player game, the aim of the game is to beat the other player (by shooting him). first i tried giving each player health, i gave them 100 health and each time they were shot they would lose 10 health. except for some reason when u shoot him 6 times the player would die. so i decided to ditch that idea.

so now, i am using a scoreing system. i created an actor for the score image (rather than using text). so i made two variables, score1 and score2. (these are actor variables). then on the actor control for the score i put:
add event>create actor>script editor
Code: Select all
score = 0;


then i put:
add event>draw actor>script editor
Code: Select all
if(score2 = 1)
{
    ChangeAnimation("scoretwo", "score1", NO_CHANGE);
}


then when i go to game mode it will put it straight to 1 instead of keeping it at 0.

how can i do a scoring system better? or how can i fix this problem?

PostPosted: Sat May 26, 2007 4:41 pm
by dimster
ok... i had another look at the score tutorial and i set a text and put:

actor control>player2>add event>collision (anyside of, player1fire, no to repeat when colliding)>script editor>
Code: Select all
score1,textNumber = score1,textNumber + 1;


but it still isnt working...

PostPosted: Sat May 26, 2007 5:21 pm
by d-soldier
The way I do it, it on the player (any of 'em) have a collision effect on contact fromt he bullet, which create an explosion actor. The explosion actor is a quick animation, which plays once and destroys itself. In it's create-actor event there is a script which says:

text_score.textNumber += 50;

Which adds fifty points to the textobject... I dont have any events set on the textobject itself. This way if the bullet goes off screen, it destroys itself, but the explosion (collision with the player)itself is what adds points. Let me know if this helped.

PostPosted: Sat May 26, 2007 6:01 pm
by dimster
well, i think i know what you are on about... but i think it would be better if you had the file.

PostPosted: Sat May 26, 2007 6:04 pm
by dimster
grrrr... just closed without saving... dammit, oh well i might try again tomorow (if you have problems opening the file i sent dont bother lol, ill probs just stop making this for a while.)

PostPosted: Sun May 27, 2007 12:11 am
by Game A Gogo
to compare two values, use "==" and not "="