score problems

Non-platform specific questions.

score problems

Postby dimster » Sat May 26, 2007 4:12 pm

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?
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby dimster » Sat May 26, 2007 4:41 pm

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...
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby d-soldier » Sat May 26, 2007 5:21 pm

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.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby dimster » Sat May 26, 2007 6:01 pm

well, i think i know what you are on about... but i think it would be better if you had the file.
Attachments
LAarena.zip
(425.88 KiB) Downloaded 110 times
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby dimster » Sat May 26, 2007 6:04 pm

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.)
Image
User avatar
dimster
 
Posts: 43
Joined: Sun May 13, 2007 9:55 am
Location: south of the north pole.
Score: 0 Give a positive score

Postby Game A Gogo » Sun May 27, 2007 12:11 am

to compare two values, use "==" and not "="
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest