Pages: 1
Topic closed
I created a game where you move a monkey around the bottom of the screen and try to catch faling bananas. I created a variable called "Score" and set it to increase whenever the monkey and bananas collided. How can I make the bananas fall faster when, for example, "Score>10"? Everything I tried hasn't really worked.
Offline
im figuring it out, wait a second
Offline
ok, i got it. here are the scripts you need for the bannana:
<when green flag clicked>
<forever>
<set x to( <pick random( -238 )to( 238
<point in direction( 180
<glide( <{ speed }> )secs to x <x position> )y
-181
<set y to( 178
<end>
<when green flag clicked>
<set{ speed }to( 5
<wait until> <( <{ score }> <>> 10 )>
<change{ speed }by( -1
<wait until> <( <{ score }> <>> 20 )>
<change{ speed }by( -1
<wait until> <( <{ score }> <>> 30 )>
<change{ speed }by( -1
<wait until> <( <{ score }> <>> 40 )>
<change{ speed }by( -1
<wait until> <( <{ score }> <>> 50 )>
<say[ you win ]for( 1 )secs>
Offline
Put a variable (speed) into your code as the movement distance, as above.
But save yourself a lot of code and use:
Set speed = score / 100
(or whatever divisor is approproate to the points you give out)
Offline
that... is a good idea. why didnt i think of that, instead of using that huge script above?
Offline
i made a demo thing of how the script would work: http://scratch.mit.edu/projects/funkymonkey/97107
Last edited by funkymonkey (2008-02-10 18:48:10)
Offline
Topic closed
Pages: 1