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

#1 2012-05-30 17:04:44

ZombieHappines
Scratcher
Registered: 2012-01-19
Posts: 100+

Tower Defense

i need a script that changes a sprites costume to the next costume when another sprite is touching it and that sprites costume is a certain one


http://i47.tinypic.com/10wr3bq.jpg
http://i50.tinypic.com/2w7onpy.png

Offline

 

#2 2012-05-30 17:32:57

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Tower Defense

In the sprite you want to change:

 
when gf clicked
forever
if <touching [sprite v}?>
switch to costune [wanted costume v]


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-05-30 20:33:00

ScratchToonie
New Scratcher
Registered: 2012-05-13
Posts: 12

Re: Tower Defense

Try this for your main sprite:

when flag clicked
forever
if <(touching [your sprite v])>
next costume
end
end
For all the sprites:
when I receive [switch to normal costume v]
change to costume [main costume v]
and then for the sprite for the another one that changes all of the sprites to the main costume

when flag clicked
if <(touching [main sprite v]
broadcast [switch to main costume v]
I hope this helps...

Offline

 

Board footer