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

#1 2010-06-14 13:51:02

Random_Guy_123
Scratcher
Registered: 2010-05-19
Posts: 71

Sprites on a level

When I change stage, the enemy sprite stays in the same position. How do I make it so it only appears on certain stages?


[url]http://scratch.mit.edu/projects/Random_Guy_123/1251479http://scratch.mit.edu/static/icons/buddy/524617_med.png?t=2010-05-28+12%3A12%3A41[/url]
Ever wanted to become a worm and avoid lots of lasers and robots? Then come check out the Worm vs. Machine game you (probably haven't) been waiting for!

Offline

 

#2 2010-06-14 18:20:03

coka
Scratcher
Registered: 2007-11-03
Posts: 1000+

Re: Sprites on a level

Use a broadcast, and receive block to tell the sprites to show, hide, or move.
Here is a guide: http://wiki.scratch.mit.edu/wiki/Broadcast


http://i42.tinypic.com/2rot8c2.png

Offline

 

#3 2010-06-14 21:17:39

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Sprites on a level

You can use the ([property] of [sprite]) sensing block to get the background # of the stage. Give the enemy sprite a list called 'my backgrounds' or something and fill it with the background numbers for which you want him to appear, say [1,3,4,7]. Then put this script on the enemy:

Code:

when I receive [change background]:
  if <[my backgrounds] contains ([background #] of [stage])>:
    show
  else
    hide

Make sure you broadcast "change background" whenever you change the background.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

Board footer