Camera move

Game Editor comments and discussion.

Re: Camera move

Postby skydereign » Tue Nov 01, 2011 9:34 am

BogdansB wrote:now I want to make the score just add the -y and not the +y. how to do it?

This code will give you more points, the lower you go.
Code: Select all
score = player.y/10;

BogdansB wrote:and how to stop the score adding the y of the player after the player destroys?

Use ActorCount. It's a function that returns how many of a certain actor there are.
Code: Select all
if(ActorCount("player")==1)
{
    score = player.y/10;
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Camera move

Postby BogdansB » Tue Nov 01, 2011 3:26 pm

thanks but i want that if player goes down, the score doesn't change at all, but if he goes up, then the score is grown up.
BogdansB
 
Posts: 94
Joined: Tue Oct 25, 2011 2:30 pm
Score: 0 Give a positive score

Re: Camera move

Postby skydereign » Tue Nov 01, 2011 8:54 pm

Oh, that's what you meant. For that, you can use the max function.
Code: Select all
score = max(score, -player.y/10);
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Camera move

Postby BogdansB » Tue Nov 01, 2011 10:51 pm

thank you very much
BogdansB
 
Posts: 94
Joined: Tue Oct 25, 2011 2:30 pm
Score: 0 Give a positive score

Previous

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest