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

#1 2008-12-31 12:42:47

Technic20
Scratcher
Registered: 2007-09-16
Posts: 69

stopping- NEED HELP!

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)


~~~Check Out My Projects!~~~

Offline

 

#2 2008-12-31 13:45:39

techy
Scratcher
Registered: 2008-12-17
Posts: 100+

Re: stopping- NEED HELP!

here

<if>   <touching[ sprite ]
<change x by( -3 )
<end>

Last edited by techy (2008-12-31 13:47:02)


Guppy Inc. making projects famous!
http://web-geeks.com/techy.gifhttp://web-geeks.com/grid.gifhttp://web-geeks.com/challenge.gif

Offline

 

#3 2008-12-31 13:50:18

Technic20
Scratcher
Registered: 2007-09-16
Posts: 69

Re: stopping- NEED HELP!

...oh yeah! thanks!


~~~Check Out My Projects!~~~

Offline

 

#4 2008-12-31 14:50:31

big-bang
Scratcher
Registered: 2008-02-21
Posts: 1000+

Re: stopping- NEED HELP!

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.


http://i47.tinypic.com/6edrbm.jpghttp://i45.tinypic.com/dw9hmw.jpghttp://i50.tinypic.com/f28tvn.jpghttp://i45.tinypic.com/ruwaop.jpg

Offline

 

#5 2008-12-31 15:00:14

Technic20
Scratcher
Registered: 2007-09-16
Posts: 69

Re: stopping- NEED HELP!

wow guys! all your help has really helped me! My Project will be out sooner thanks to you!


~~~Check Out My Projects!~~~

Offline

 

#6 2008-12-31 15:21:48

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: stopping- NEED HELP!

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

 

Board footer