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

#1 2012-05-28 19:02:05

Ethan190c
New Scratcher
Registered: 2012-05-28
Posts: 2

Attacks

Well I'm doing a game but I want it so that when sprite one's costume 3 touches sprite three sprite 3 gets hit. I appreciate your advice!

Offline

 

#2 2012-05-28 19:12:26

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

Re: Attacks

Let me see... what do you mean by hit, is it something like this?

For sprite 1

when flag clicked
if <touching [Sprite3 v]>
  broadcast [Sprite 3 gets hit v]
end
and for sprite 3

when I receive [Sprite 3 gets hit v]
broadcast [get hit v]
when I receive [get hit v]
change x by [5]
I don't get it..

Offline

 

#3 2012-05-28 20:27:28

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: Attacks

This should work,

when gf clicked
if <<touching [sprite 3 v]?> and <(costume #) = [3]>>
broadcast [hit v]
Just make sure that you put this script in sprite 1, and it will work.  smile

Last edited by sonicfan12p (2012-05-28 20:28:32)


Why are the secret organizations getting all the attention?  mad

Offline

 

#4 2012-05-29 20:12:04

Ethan190c
New Scratcher
Registered: 2012-05-28
Posts: 2

Re: Attacks

Thanks I'm good now!

Offline

 

Board footer