Pages: 1
Topic closed
Long title, I know. But what I want to know, is, the title. How do I make a sprite spin without changing the direction? I can't use the
[blocks]<turn cw( )degrees>[/blocks]
blocks because that would change the direction. What I'm doing, is, making the Scratch Cat point towards the mouse pointer, until your mouse is down. Then...well, you'd understand better with a picture.
My thoughts...why can't I get the BBcode for this image?!? oh well...
http://m.flickr.com/#/photos/tinsenpup/5061252923/
That's the link. I can't find the-oh! I just figured...oh, no I didn't. So yes, does anyone know how I can make the sprite spin without changing the direction? I could use different costumes, but it wouldn't be very good quality. So, does anyone know how?
Offline
Well actually the rotating would have the same quality as many costumes since Scratch isn't vectored. But besides these two ways, there's no other way to do it. Why can't you use the rotate block? What does the direction changing have to do with it?
Offline
Ace-Of-Diamonds wrote:
Well actually the rotating would have the same quality as many costumes since Scratch isn't vectored. But besides these two ways, there's no other way to do it. Why can't you use the rotate block? What does the direction changing have to do with it?
I need the sprite to spin while moving in a straight line. Well, I don't need it, but it would be useful to have.
Offline
If it isn't a 1s1s, how about making another sprite that moves in the straight line and add
[blocks]
<forever>
<go to[ the sprite
[/blocks]
to the Scratch cat.
Offline
I have no idea how to do that...
Guinea_Pig_Girl wrote:
My thoughts...why can't I get the BBcode for this image?!? oh well...
http://m.flickr.com/#/photos/tinsenpup/5061252923/
That's because you have chosen "All Rights Reserved".
Offline
mathematics wrote:
I have no idea how to do that...
Guinea_Pig_Girl wrote:
My thoughts...why can't I get the BBcode for this image?!? oh well...
http://m.flickr.com/#/photos/tinsenpup/5061252923/That's because you have chosen "All Rights Reserved".
I guess you're right, because it is my mother's account, not mine. I have Picasa set up now though. http://picasaweb.google.com/tinsenhockey/ScratchThings# That's the link, if you want to look at it.
Offline
Make a variable and record your direction.
Move towards the mouse.
Point in the variable's direction.
Change the variable.
Offline
You can make it rotating while you change the x or y. That would keep it in a straight line, and it wouldn't move towards the way you point towards but towards the direction you want it to go.
Offline
Hmmm. Combining Ace-of-Diamonds' idea and juststickman's idea might just work....
Oh! Didn't notice Hardman123's post. Yes, that would probably work too. I'll try all your ideas, and see what I get! Thanks for helping, everyone!
Offline
Are you only going for up-down or left-right movement? If you're only doing that, just use change x/y. There's no need to create a variable for it if it's for 90 degree stuff.
Offline
Ace-Of-Diamonds wrote:
Are you only going for up-down or left-right movement? If you're only doing that, just use change x/y. There's no need to create a variable for it if it's for 90 degree stuff.
It points towards the mouse-pointer, so there's no fixed place it's going.
Offline
Then you'll have to have a variable tracking the sprites rotation as well as the direction you want it to point in. Otherwise, it'll spin some, then spin back facing the mouse then start spinning again, only to face the mouse again after nearly a second. I'm not sure how this would play out in presentation mode. Why does the sprite need to spin?
Offline
Guinea_Pig_Girl wrote:
Ace-Of-Diamonds wrote:
Well actually the rotating would have the same quality as many costumes since Scratch isn't vectored. But besides these two ways, there's no other way to do it. Why can't you use the rotate block? What does the direction changing have to do with it?
I need the sprite to spin while moving in a straight line.
Well, I don't need it, but it would be useful to have.
![]()
Here's how to do that....have one sprite do the motion and another sprite do the spinning and also have it goto the location of the first sprite continuously. The sprite doing the motion can be hidden or made transparent.
Offline
Ace-Of-Diamonds wrote:
Then you'll have to have a variable tracking the sprites rotation as well as the direction you want it to point in. Otherwise, it'll spin some, then spin back facing the mouse then start spinning again, only to face the mouse again after nearly a second. I'm not sure how this would play out in presentation mode. Why does the sprite need to spin?
Alright now you've got me confused. XD I better explain from the beginning. I think we're all a bit confused here.
If you have a look at the code, which I have a link to in my first post, the sprite points towards the mouse pointer until you click. Then it moves 10 steps until it reaches the edge. What I'd like to do, is have it spin while it moves 10 steps. There are many methods here, and I daresay at least one of them works. The script I have is:
[blocks]<when green flag clicked>
<repeat until><mouse down?>
<point towards( mouse-pointer
<end>
<repeat until><touching[ edge
<move( 10 )steps>
<end>
[/blocks]
I want it to spin while moving 10 steps. It's not required, just an extra effect. Anyway, nothing urgent anyway.
Offline
Paddle2See wrote:
Guinea_Pig_Girl wrote:
Ace-Of-Diamonds wrote:
Well actually the rotating would have the same quality as many costumes since Scratch isn't vectored. But besides these two ways, there's no other way to do it. Why can't you use the rotate block? What does the direction changing have to do with it?
I need the sprite to spin while moving in a straight line.
Well, I don't need it, but it would be useful to have.
![]()
Here's how to do that....have one sprite do the motion and another sprite do the spinning and also have it goto the location of the first sprite continuously. The sprite doing the motion can be hidden or made transparent.
What? Ohh! I did such a long post that you posted!! Well, it seems like that'd work, but I need to go to bed now, so I'll try it in the morining. Thanks for solving my problem everyone!
Offline
um, what about the "don't rotate" button next to the sprite thumbnail?
Offline
ScratchReallyROCKS wrote:
um, what about the "don't rotate" button next to the sprite thumbnail?
This is by far the simplest solution if you don't want your sprite to ever rotate. If you're looking for a "cleaner" solution, scmb1's will work, although it is a bit more math-heavy. Paddle2See's is quite flexible, too, and does essentially the same thing with less scripting. Pick which one suits you best and go for it!
(I much prefer scmb1's solution: trigonometry is my thing.)
Offline
Topic closed
Pages: 1