This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-02-10 11:49:07

James135
Scratcher
Registered: 2008-02-10
Posts: 3

How can I increase the difficulty based on the score?

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

 

#2 2008-02-10 12:02:54

Jman720
Scratcher
Registered: 2007-11-27
Posts: 1000+

Re: How can I increase the difficulty based on the score?

In the number section of blocks on scratch there is a when blank = blank, try putting the variable score in one blank space and 10 in the other.


Solve for x
2+3+2+(-9)+1x+2x=7

Offline

 

#3 2008-02-10 13:14:02

James135
Scratcher
Registered: 2008-02-10
Posts: 3

Re: How can I increase the difficulty based on the score?

I tried that, but I had to do __>__ because i want it to work above that score as well.

Offline

 

#4 2008-02-10 13:23:34

funkymonkey
Scratcher
Registered: 2007-06-03
Posts: 1000+

Re: How can I increase the difficulty based on the score?

im figuring it out, wait a second


http://i243.photobucket.com/albums/ff67/hprules_photos/banner2.jpg
Kuzimu: Dawn of a New Age                                                                                                  Coming May 2010

Offline

 

#5 2008-02-10 13:31:47

funkymonkey
Scratcher
Registered: 2007-06-03
Posts: 1000+

Re: How can I increase the difficulty based on the score?

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 sad  <x position> )y sad  -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>


http://i243.photobucket.com/albums/ff67/hprules_photos/banner2.jpg
Kuzimu: Dawn of a New Age                                                                                                  Coming May 2010

Offline

 

#6 2008-02-10 13:43:49

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: How can I increase the difficulty based on the score?

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)


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#7 2008-02-10 16:37:40

funkymonkey
Scratcher
Registered: 2007-06-03
Posts: 1000+

Re: How can I increase the difficulty based on the score?

that... is a good idea. why didnt i think of that, instead of using that huge script above?


http://i243.photobucket.com/albums/ff67/hprules_photos/banner2.jpg
Kuzimu: Dawn of a New Age                                                                                                  Coming May 2010

Offline

 

#8 2008-02-10 18:18:19

James135
Scratcher
Registered: 2008-02-10
Posts: 3

Re: How can I increase the difficulty based on the score?

Thanks everyone for replying! I got it now

Offline

 

#9 2008-02-10 18:41:34

funkymonkey
Scratcher
Registered: 2007-06-03
Posts: 1000+

Re: How can I increase the difficulty based on the score?

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)


http://i243.photobucket.com/albums/ff67/hprules_photos/banner2.jpg
Kuzimu: Dawn of a New Age                                                                                                  Coming May 2010

Offline

 

Board footer