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

#1 2008-10-08 01:58:15

jarnww
Scratcher
Registered: 2008-09-10
Posts: 2

Making Functioning Doors

Hi there everyone! I'm working on a game for my English class, but I've run into a bit of a snag.

I want the background to change to a different one when a sprite (the player) touches another sprite (the door). How could I do this?

Offline

 

#2 2008-10-08 03:02:11

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Making Functioning Doors

Hi jarnww,

this is a classic situation in which broadcasting a message by the door-sprite and letting the stage react to receiving that message by switching to another background should do the trick:

door-sprite:

[blocks]
<when green flag clicked>
<forever if><touching[ player
  <broadcast[ openDoor
<end>
[/blocks]

stage:

[blocks]
<when I receive[ openDoor
<next costume>
[/blocks]

Does that help?


Jens Mönig

Offline

 

#3 2008-10-08 10:34:10

jarnww
Scratcher
Registered: 2008-09-10
Posts: 2

Re: Making Functioning Doors

Yes it does! Thank you very much!

Offline

 

Board footer