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

#1 2012-10-24 08:35:29

edxforme
New Scratcher
Registered: 2012-10-22
Posts: 9

help me please in looping

how to make this script work the way i want to. keep looping vertically (up motion from bottom of stage to top in 0 second). or after it touches a sprite edge of stage loop. also send a crore to a score box

when plag click
forever
move 4 step
point in direction 0

Offline

 

#2 2012-10-24 11:15:16

edxforme
New Scratcher
Registered: 2012-10-22
Posts: 9

Re: help me please in looping

how to make this script work the way i want to. keep looping vertically (up motion from bottom of stage). or after it touches a sprite at the top of the stage or edge of stage then loop. also send a score to a score box

when flag click
forever
move 4 step
point in direction 0

Offline

 

#3 2012-10-24 11:34:57

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: help me please in looping

edxforme wrote:

how to make this script work the way i want to. keep looping vertically (up motion from bottom of stage). or after it touches a sprite at the top of the stage or edge of stage then loop. also send a score to a score box

when flag click
forever
move 4 step
point in direction 0

This is part of a script from My Gauntlet Game where a ball moves from when end of the screen to the other when it touches a colour- i have changed it so it is touching two sprites and heads to the opposite end when it touches one of the sprites. If you only want one sprite take out the second "if touching"

when gf clicked
go to <x: (0), y: (0) >
forever
if (touching [sprite 1])
change y by <what ever you want>
if (touching [sprite 2])
change y by <- what ever you want>
sorry about the bad scratchblocks

Last edited by Willpower (2012-10-24 11:37:59)


http://i49.tinypic.com/e84kdj.png

Offline

 

#4 2012-10-24 18:47:04

edxforme
New Scratcher
Registered: 2012-10-22
Posts: 9

Re: help me please in looping

willpower
thank you very much

Offline

 

#5 2012-10-27 15:42:07

edxforme
New Scratcher
Registered: 2012-10-22
Posts: 9

Re: help me please in looping

willpower
thank you, in addition to the above i need when touch the score go up by 6 and if it touches another it go down by 3..... also when it go to a minus score i have a broadcast saying game over.....help please thank you

Offline

 

#6 2012-10-27 15:45:29

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: help me please in looping

Willpower wrote:

edxforme wrote:

how to make this script work the way i want to. keep looping vertically (up motion from bottom of stage). or after it touches a sprite at the top of the stage or edge of stage then loop. also send a score to a score box

when flag click
forever
move 4 step
point in direction 0

This is part of a script from My Gauntlet Game where a ball moves from when end of the screen to the other when it touches a colour- i have changed it so it is touching two sprites and heads to the opposite end when it touches one of the sprites. If you only want one sprite take out the second "if touching"

when gf clicked
go to x: (0) y: (0) 
forever
if <touching [sprite 1 v]?>
change y by (what ever you want)
if <touching [sprite 2 v]?>
change y by (what ever you want)
sorry about the bad scratchblocks

Fixed for you.

Last edited by Firedrake969 (2012-10-27 15:45:42)


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#7 2012-10-27 16:00:10

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: help me please in looping

I think you're looking for this:

when gf clicked
set [score v] to [0]
go to x: (0) y: (-180)
point in direction (0)
forever
 move (4) steps
 if <<<touching [edge v]?> and <(y position) > [0]>> or <touching [sprite at top v]?>>
  change [score v] by (6)
 end
 if <touching [bad sprite v]?>
  change [score v] by (-3)
 end
 if <(score) < [0]>
  broadcast [game over v]
 end

Offline

 

Board footer