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

#1 2012-04-06 18:04:23

myhorsejustsatonme
New Scratcher
Registered: 2012-03-29
Posts: 1

how to change back ground when sprite on edge

how do you make the background change when your sprite is on the edge?

Offline

 

#2 2012-04-06 18:14:58

ftf841
Scratcher
Registered: 2012-02-19
Posts: 1000+

Re: how to change back ground when sprite on edge

when gf clicked
forever if <touching [edge v] ?>
switch to background [somthing v]

Last edited by ftf841 (2012-04-06 19:40:06)


http://mag.racked.eu/cimage/i9002/Achievement++get%21/Hi+there./mca.png
http://mag.racked.eu/mcimage/i354/Achievement++get%21/CAKE%21%21%21%21%21/mca.png

Offline

 

#3 2012-04-06 18:20:47

aryabtsev
Scratcher
Registered: 2012-02-05
Posts: 81

Re: how to change back ground when sprite on edge

when flag clicked
forever
if <touching [edge v] ?>
broadcast [hi! v]
wait until <not <touching [edge v]?>>
end
end
And for stage:
when I receive [hi! v]
switch to background [awesome background v]

Last edited by aryabtsev (2012-04-12 22:50:47)


http://i.imgur.com/NX7AO.jpg

Offline

 

#4 2012-04-06 21:58:13

SOScratch
Scratcher
Registered: 2010-02-01
Posts: 100+

Re: how to change back ground when sprite on edge

when gf clicked
forever
     if <(touching [edge v])>
          switch to background [ v]

Last edited by SOScratch (2012-04-06 21:58:39)


-SOScratch
Scratch On!

Offline

 

#5 2012-04-06 22:04:08

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: how to change back ground when sprite on edge

SOScratch wrote:

when gf clicked
forever
     if (touching [edge v]?)
          switch to background [ v]

Offline

 

#6 2012-04-06 22:54:06

aryabtsev
Scratcher
Registered: 2012-02-05
Posts: 81

Re: how to change back ground when sprite on edge

@SOScratch, @ftf841 and @joletole :
Backgrounds can't use <touching edge?>
He wants to do it when a sprite touches edge!


http://i.imgur.com/NX7AO.jpg

Offline

 

#7 2012-04-09 04:09:20

bluecat600
Scratcher
Registered: 2012-02-12
Posts: 500+

Re: how to change back ground when sprite on edge

when your sprite touches the edge, make it brodcast a message. When the stage recives the messaage, it will change the backgrond.


I gaze off into the boundless skyline, noteblock choirs playin in the sunshine, turn round pick up my sword and wield the blade that once forced evil mobs to yield, if this battle shall leave me slain, I know Herobrine still calls my name, better just take a stand, that was when I ruled the land.

Offline

 

#8 2012-04-09 11:31:07

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: how to change back ground when sprite on edge

Sprite

if <touching [edge v]?>
 set [on edge v] to (1)
else
 set [on edge v] to (0)
end
Stage
if <(on edge) = (1)>
 switch to background [edge v]
else
 switch to background [no edge v]
end
And put
when gf clicked
forever



over both of the scripts.

Last edited by chanmanpartyman (2012-04-09 11:31:35)

Offline

 

Board footer