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

#1 2010-06-24 11:57:54

dehrha02
Scratcher
Registered: 2007-05-18
Posts: 19

One side of sprite always facing another sprite

Hi Everybody,  I'm conducting a scratch camp right now.  I have a question about a sprite.

How do you make one side of a sprite always face another sprite that it is following around and trying to catch.

Offline

 

#2 2010-06-24 12:04:02

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: One side of sprite always facing another sprite

Can you reword it.

I think it would be normal to do it like this:

      __
    | O |
      ¯¯

Have 4 sprites as sensors. They have a ghost effect set to 100 so you cant see them.
Then make a list with 4 lines and link a line up to each sensor like:

When ¶ clicked
forever
| if <touching |OTHER SPRITE v|>
| replace item |1| of |Sensors| with |Yes|
| else
| replace item |1| of |Sensors| with |No|
_______________________________________
_______________________________________


You can now reach me on Twitter @johnnydean1_

Offline

 

#3 2010-06-24 12:25:06

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: One side of sprite always facing another sprite

johnnydean1 wrote:

Can you reword it.

I think it would be normal to do it like this:

      __
    | O |
      ¯¯

Have 4 sprites as sensors. They have a ghost effect set to 100 so you cant see them.
Then make a list with 4 lines and link a line up to each sensor like:

When ¶ clicked
forever
| if <touching |OTHER SPRITE v|>
| replace item |1| of |Sensors| with |Yes|
| else
| replace item |1| of |Sensors| with |No|
_______________________________________
_______________________________________

First of all, that's really ineffective.

Second, you could do this:

When green flag clicked:
|Forever|
point towards [target sprite]
|End forever|


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#4 2010-06-24 12:44:35

Red-dino
Scratcher
Registered: 2010-06-08
Posts: 48

Re: One side of sprite always facing another sprite

All you have to do is when drawing the sprite make what you want to be the front of the sprite pointing -> this way then use the script juststickman suggested. smile  Hope that helped.


http://i45.tinypic.com/28slsmo.png
helper  big_smile

Offline

 

#5 2010-06-24 13:06:18

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: One side of sprite always facing another sprite

Yes. IT would help if you uploaded a sample project.....

My best answer would me to use the "point towards" block.  big_smile


Hai.

Offline

 

Board footer