Hello Every1,
Im working on a project, using sprites walking around (an RPG) and this is a bit n00bish, but you know the
[blocks]<if on edge, bounce>[/blocks]
button, I'm looking for a way to apply this to the character so that when he hits that sprite, it is like a boundary and he can't walk on it.
I mean a bit like applying
[blocks]<if on edge, bounce>[/blocks]
to the sprite, but instead of if on EDGE, I want if hitting sprite?
uh.... that was gibberish. I hope someone understands what I mean, and hopefully you can help!
Thanks
~T20
Last edited by Technic20 (2008-12-31 12:43:13)
Offline
here
<if> <touching[ sprite ]
<change x by( -3 )
<end>
Last edited by techy (2008-12-31 13:47:02)
Offline
techy wrote:
here
[blocks]<if> <touching[ sprite ]
<change x by( -3 )
<end>[/blocks]
Actually, this won't work as well because it only works in one direction. If your sprite always moves in a forever block:
[blocks]<when green flag clicked>
<forever>
<move( 3 )steps>
<if><touching[ Bouncy Sprite
<point in direction( (( <direction> <-> 180 ))
<end>[/blocks]
This will work in all directions with an equal angle of incidence.
Offline
the most effective way is the one i used in my rpg.
[blocks]
<when green flag clicked>
<forever>
<if><touching[ object ]
<set x to( <{ prev X }> )
<set y to( <{ prev Y }> )
<else>
<set{ prev X }to( <x position>)
<set{ prev Y }to( <y position>)
<end>
<end>
[/blocks]
that SHOULD work
Offline