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

#1 2012-10-28 16:03:57

Louis100
New Scratcher
Registered: 2012-10-28
Posts: 2

Banana won't reset to the top of the page

I'm making a game where there are bananas falling from the sky and a character below has to catch them, and if a banana hits the floor, then the game ends. I'm having trouble making the banana reset to the top of the screen after it touches the character. This means that instead of 1 point per banana it is more like 50 per banana, and the game ends after 1 banana touches the ground. I need help with this.

Offline

 

#2 2012-10-28 16:22:12

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Banana won't reset to the top of the page

Try using this with your bananas:

when gf clicked
forever
 if (touching [character v]?)
  change [score v] by (1)
  go to x: (pick random (-240) to (240)) y: (180)//Resets banana's position.
 else
  change y by (-1)//Adjust to make your banana faster/slower.
 End
 if <(x position) < (x position of floor)>
  Game over scripts
 end
I hope that this helps!

Last edited by ErnieParke (2012-11-04 17:59:18)


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2012-10-29 08:51:02

Louis100
New Scratcher
Registered: 2012-10-28
Posts: 2

Re: Banana won't reset to the top of the page

It doesn't seem to want to reset to the top of the screen. Thanks though!

Offline

 

#4 2012-10-29 11:37:32

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Banana won't reset to the top of the page

What you want is this:

when gf clicked
forever  
hide
wait (pick random (1) to (2)) secs
show
go to x: (pick random (-200) to (200)) y: (170)
repeat until <<touching [character v]?> or <touching [ground v]?>>  
change y by (-3)
end
if <touching [character v]?> 
change [points v] by (1)
end
if <touching [ground v]?> 
stop all 
end
end


Hai.

Offline

 

Board footer