How make the background change its speed while certain conditions?

M

Mauricio Antunes

Guest
Hi

My game is almost done but something appeared to delay it a little.
I want to make the background scroll vertically but with different speeds at different score conditions.
How can i do that? ^_^
I know i have to use vspeed and if statement but i have no idea how organize this to work =o!
Please help =D
 
N

Never Mind

Guest
Code:
//Good Job!
Score += 1;
background_vspeed[0] += 1;
 
M

Mauricio Antunes

Guest
Code:
//Good Job!
Score += 1;
background_vspeed[0] += 1;
wow thanks!
Sorry if i'm asking too much but, how could i divide this into 4 odd scores?
Like this

1500 +2 speed
5000 +4 speed
9000 +6 speed
1200 +8 speed
 
N

Never Mind

Guest
background_vspeed[] is a variable that you can control.
Conditionals allow you to give variables non-linear relationships, like what you're asking to do.
If you've never heard of an if-then statement, I advise doing research and completing more tutorials.

Look through the list of drag n' drop actions. It is pretty straight forward how to use them:






Read the manual!

//you can modify this to your needs
if score >= 1500
background_vspeed[0] = 2;
else if score >=5000
background_vspeed[0] = 4;
else if score >=9000
background_vspeed[0] = 6;
else if score >=12000
background_vspeed[0] = 8;
 
Last edited by a moderator:
M

Mauricio Antunes

Guest
background_vspeed[] is a variable that you can control.
Conditionals allow you to give variables non-linear relationships, like what you're asking to do.
If you've never heard of an if-then statement, I advise doing research and completing more tutorials.

Look through the list of drag n' drop actions. It is pretty straight forward how to use them:






Read the manual!

//you can modify this to your needs
if score >= 1500
background_vspeed[0] = 2;
else if score >=5000
background_vspeed[0] = 4;
else if score >=9000
background_vspeed[0] = 6;
else if score >=12000
background_vspeed[0] = 8;

Thanks a lot.
I read the manuals and the if statement but like i said i'm still pretty newbie at this so i'm having problems to apply everything i read ^_^
Thanks again for the help =D
 
Top