Pages: 1
I have a cat and a dragon. I entered for the dragon "if touching cat, play drum for .2 beats" but nothing happens when I have the cat touch the dragon. (My sound is on, and I have tried this with other sprites.) Am I missing something required to have sprites touch each other be part of a Boolean command?
Thanks!
Offline
for cat:
when gf clicked wait until <touching [dragon v]?> play drum (48 v) for (0.2) beats
Offline
amyhand wrote:
I have a cat and a dragon. I entered for the dragon "if touching cat, play drum for .2 beats" but nothing happens when I have the cat touch the dragon. (My sound is on, and I have tried this with other sprites.) Am I missing something required to have sprites touch each other be part of a Boolean command?
Thanks!
You need a forever loop around the if.
Offline
[scratchblocks]
when gf clicked
forever
if (touching dragon)
Play Drum Beat
end
[scratchblocks/]
(Still learning how to use scratch blocks.)
Offline
when gf clicked
forever
if (touching dragon)
Play Drum Beat
end
[/scratchblocks]
(Still learning how to use scratch blocks.)
Fixed it a bit.
Offline
Dsteenson wrote:
when gf clicked forever if <touching [dragon v]?> Play sound [Drum Beat v](Still learning how to use scratch blocks.)
Last edited by zammer990 (2012-11-01 13:43:36)
Offline
amyhand wrote:
I have a cat and a dragon. I entered for the dragon "if touching cat, play drum for .2 beats" but nothing happens when I have the cat touch the dragon. (My sound is on, and I have tried this with other sprites.) Am I missing something required to have sprites touch each other be part of a Boolean command?
Thanks!
It looks like your problem has already been solved, but if this was your script:
when gf clicked//or some other hat block if <touching [cat v]?> play drum (48 v) for (0.2) beatsThen it will only check if it is touching the cat at the moment the green flag is clicked.
when gf clicked//or some other hat block wait until <touching [cat v]?> play drum (48 v) for (0.2) beats
Offline
awesomeness321 wrote:
amyhand wrote:
I have a cat and a dragon. I entered for the dragon "if touching cat, play drum for .2 beats" but nothing happens when I have the cat touch the dragon. (My sound is on, and I have tried this with other sprites.) Am I missing something required to have sprites touch each other be part of a Boolean command?
Thanks!It looks like your problem has already been solved, but if this was your script:
when gf clicked//or some other hat block if <touching [cat v]?> play drum (48 v) for (0.2) beatsThen it will only check if it is touching the cat at the moment the green flag is clicked.
Use this script (which MoreGamesNow already suggested):when gf clicked//or some other hat block wait until <touching [cat v]?> play drum (48 v) for (0.2) beats
It sounded like he wanted it to be repeatable, if it does need to happen more than once, use the forever version, if it's only once. use the wait until version
Offline
Pages: 1