Discuss Scratch

  • Discussion Forums
  • » Help with Scripts
  • » How to make my falling sprites disappear when they sense video motion, then reappear at the top of the screen to fall again in a loop? [RSS Feed]
gleamez
New Scratcher
1 post

How to make my falling sprites disappear when they sense video motion, then reappear at the top of the screen to fall again in a loop?

Working on a falling rocks game where you turn on ur video and physically avoid the rocks on screen with your body. If a rock sprite detects any motion, I want the sprite to disappear then fall from the top of the screen again at a random point on the x axis.

With the code I have now, this will happen correctly the FIRST time a sprite detects motion, but any time after, the sprite will detect the motion but will continue falling as normal and won't regenerate back to the top of the screen.
GIitchInTheMatrix
Scratcher
1000+ posts

How to make my falling sprites disappear when they sense video motion, then reappear at the top of the screen to fall again in a loop?

forever
change y by (velocity)
change [Velocity v] by (-1)
if <(video [motion(i think) v] on [Stage v]) > [10]> then
hide
go to x: (pick random (-240) to (240)) y: (180)
set [Velocity v] to []
end
end
Oumuamua
Scratcher
1000+ posts

How to make my falling sprites disappear when they sense video motion, then reappear at the top of the screen to fall again in a loop?

  • Discussion Forums
  • » Help with Scripts
  • » How to make my falling sprites disappear when they sense video motion, then reappear at the top of the screen to fall again in a loop? [RSS Feed]

Powered by DjangoBB