Discuss Scratch

gpacademy
Scratcher
1 post

How to tell what direction a sprite is facing?

How can we determine what direction a sprite is facing? Not the direction it is *moving*, but the direction the sprite is facing? We have a game where the sprite can move up and down, and left and right, and we want to fire either to the right or left.

Thank you.
xlk
Scratcher
100+ posts

How to tell what direction a sprite is facing?

if <direction>0>
it is facing left
else
it is facing right, duh

Hope that's what you mean!
Lone-Wolf
Scratcher
87 posts

How to tell what direction a sprite is facing?

What xlk said, there is a block in Motion called direction. 0 is up, 90 is right, -90 is left, and 180 is down. To try this out, create a sprite and make it “Forever point towards mouse pointer” then click the box on the direction block to make the direction amount visible. This will tell you the direction degree.
dracae
Scratcher
1000+ posts

How to tell what direction a sprite is facing?

Lone-Wolf wrote:

0 is up, 90 is right, -90 is left, and 180 is down.

I apologize in advance for being a bit of a pest, but:
0 = right ; 90 = up ; 180 is left ; -90 or 270 is down

Just making this correction, so that other Scratchers aren't confused.
Anyways, I just want to point it out!
kayybee
Scratcher
1000+ posts

How to tell what direction a sprite is facing?

dracae wrote:

Lone-Wolf wrote:

0 is up, 90 is right, -90 is left, and 180 is down.

I apologize in advance for being a bit of a pest, but:
0 = right ; 90 = up ; 180 is left ; -90 or 270 is down

Just making this correction, so that other Scratchers aren't confused.
Anyways, I just want to point it out!
Not in scratch. Scratch calculates angles a weird way.

You're probably thinking about the way the unit circle and stuff measures angles.
Lone-Wolf
Scratcher
87 posts

How to tell what direction a sprite is facing?

kayybee wrote:

Not in scratch. Scratch calculates angles a weird way.

You're probably thinking about the way the unit circle and stuff measures angles.

Yeah, that's what I thought. I checked the “Make Sprite point in direction” thing. It says what I said, so…
dracae
Scratcher
1000+ posts

How to tell what direction a sprite is facing?

Oh wait, I meant something else… : |
Say you have the scratch cat.
The degree measure for the direction points the cat in different ways.
Whatever, it's kinda confusing anyways…
xlk
Scratcher
100+ posts

How to tell what direction a sprite is facing?

Scratch measures angle similarly to clock, from top, clockwise. In math, you go from right, counterclokwise. Thing is, switching between them is easy, luckly…
smartypants367
Scratcher
1 post

How to tell what direction a sprite is facing?

How does one switch between the clock notation and vector notation?
badatprogrammingibe
Scratcher
500+ posts

How to tell what direction a sprite is facing?

smartypants367 wrote:

How does one switch between the clock notation and vector notation?
What is clock notation?

EDIT: Also, on a side note, when you want to ask a question, it helps if you do it in a new thread. This way more people can help you.

Last edited by badatprogrammingibe (Sept. 30, 2018 08:14:43)

deck26
Scratcher
1000+ posts

How to tell what direction a sprite is facing?

badatprogrammingibe wrote:

smartypants367 wrote:

How does one switch between the clock notation and vector notation?
What is clock notation?

EDIT: Also, on a side note, when you want to ask a question, it helps if you do it in a new thread. This way more people can help you.
And you don't bring an old topic back to the top of the forum - people won't necessarily read as far as your question. Creating a new topic is the right way to ask a question.
DFISAWESOME
Scratcher
11 posts

How to tell what direction a sprite is facing?

Right-click the sprite you're trying to check and click info. In the top right beneath the camera icon, it will show the direction and next to it, it will show the exact degree.

Last edited by DFISAWESOME (Oct. 1, 2018 01:00:31)

deck26
Scratcher
1000+ posts

How to tell what direction a sprite is facing?

DFISAWESOME wrote:

Right-click the sprite you're trying to check and click info. In the top right beneath the camera icon, it will show the direction and next to it, it will show the exact degree.
Please don't necropost - check the date of the topic before you respond. If it's more than ayear old it's rarely worth posting.
ScratchYTMB
Scratcher
100 posts

How to tell what direction a sprite is facing?

xlk wrote:

if <direction>0>
it is facing left
else
it is facing right, duh

Hope that's what you mean!
i dont think this works lemme checc
The_Imaginarium
Scratcher
1000+ posts

How to tell what direction a sprite is facing?

ScratchYTMB wrote:

xlk wrote:

if <direction>0>
it is facing left
else
it is facing right, duh

Hope that's what you mean!
i dont think this works lemme checc
Welcome to the forums! Remember to check the date of a topic before posting.
https://scratch.mit.edu/discuss/topic/355062/

Powered by DjangoBB