Pages: 1
I have a program now where you control one sprite and the other one randomly bounces around and you have to avoid it. How do I count the number of times that your user controlled sprite hits the random one? The object of the game is to avoid the other sprite.
Offline
do a "When [name of sprite] hits [color outlining other sprite]" block. Then put under a "Change variable by -1" or +1. depending.
Offline
WOLFLOVER458 wrote:
do a "When [name of sprite] hits [color outlining other sprite]"That doesn't exist. I think you mean 'if <touching color [color outlining other sprite]> block. Then put under a "Change variable by -1" or +1. depending.
Uh, that doesn't exist. I think you mean this:
when gf clicked forever if <touching color [color outlining other sprite]?> change [whatever the variable is called v] by (1)//or -1 if you want it to go down.But that would only work if the sprite was outlined by 1 color.
when gf clicked forever if <touching [other sprite's name v]?> change [whatever the variable is called v] by (1)//or -1 if you want it to go down.
Offline
awesomeness321 wrote:
WOLFLOVER458 wrote:
do a "When [name of sprite] hits [color outlining other sprite]"That doesn't exist. I think you mean 'if <touching color [color outlining other sprite]> block. Then put under a "Change variable by -1" or +1. depending.
Uh, that doesn't exist. I think you mean this:
when gf clicked forever if <touching color [color outlining other sprite]?> change [whatever the variable is called v] by (1)//or -1 if you want it to go down.But that would only work if the sprite was outlined by 1 color.
Instead, you could use this:when gf clicked forever if <touching [other sprite's name v]?> change [whatever the variable is called v] by (1)//or -1 if you want it to go down. wait until <not <touching [sprite whatever v] //So it doesn't add more than one each time it touches.
Offline
mythbusteranimator wrote:
awesomeness321 wrote:
WOLFLOVER458 wrote:
do a "When [name of sprite] hits [color outlining other sprite]"That doesn't exist. I think you mean 'if <touching color [color outlining other sprite]> block. Then put under a "Change variable by -1" or +1. depending.
Uh, that doesn't exist. I think you mean this:
when gf clicked forever if <touching color [color outlining other sprite]?> change [whatever the variable is called v] by (1)//or -1 if you want it to go down.But that would only work if the sprite was outlined by 1 color.
Instead, you could use this:when gf clicked forever if <touching [other sprite's name v]?> change [whatever the variable is called v] by (1)//or -1 if you want it to go down. wait until <not (touching [sprite whatever v]?)> //So it doesn't add more than one each time it touches.
Fixed.
Last edited by ErnieParke (2012-11-06 15:18:17)
Offline
So to summarize the posts above me, this script would be inserted at the player controlled sprite:
when gf clicked forever if <touching [opponentSprite v] ?> change [points v] by (-1) //or +1 wait until <not<touching [opponentSprite v] ?>> end end
Last edited by fg123 (2012-11-06 15:30:41)
Offline
Pages: 1