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

#1 2010-06-22 20:37:45

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Math Q

I'm trying to make something where you can drag a object around a circle and it will snap to the place on the circle below/above it.  How could I do this?


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#2 2010-06-22 20:51:31

bananaman114
Scratcher
Registered: 2010-03-15
Posts: 1000+

Re: Math Q

should be moved...


the sun still shines

Offline

 

#3 2010-06-22 20:53:09

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Math Q

Looks like this will better be suited for All About Scratch. Don't fret, I'll move it!

I'm not sure what you mean... Are you talking about something like the arms on my Stickfigure Animator?

Offline

 

#4 2010-06-22 21:00:42

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

coolstuff wrote:

Looks like this will better be suited for All About Scratch. Don't fret, I'll move it!

I'm not sure what you mean... Are you talking about something like the arms on my Stickfigure Animator?

No, it's an object that sits on the outer edge of a circle.  I want to be able to drag it and have it go to the corresponding point on the circle.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#5 2010-06-22 21:06:38

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Math Q

AtomicBawm3 wrote:

coolstuff wrote:

Looks like this will better be suited for All About Scratch. Don't fret, I'll move it!

I'm not sure what you mean... Are you talking about something like the arms on my Stickfigure Animator?

No, it's an object that sits on the outer edge of a circle.  I want to be able to drag it and have it go to the corresponding point on the circle.

Hmm... You mean to rotate the circle? Or to drag the circle? Or to drag the dot and have it stay in the radius of the circle?

Offline

 

#6 2010-06-22 21:07:34

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

coolstuff wrote:

AtomicBawm3 wrote:

coolstuff wrote:

Looks like this will better be suited for All About Scratch. Don't fret, I'll move it!

I'm not sure what you mean... Are you talking about something like the arms on my Stickfigure Animator?

No, it's an object that sits on the outer edge of a circle.  I want to be able to drag it and have it go to the corresponding point on the circle.

Hmm... You mean to rotate the circle? Or to drag the circle? Or to drag the dot and have it stay in the radius of the circle?

last one.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#7 2010-06-22 21:23:31

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Math Q

AtomicBawm3 wrote:

coolstuff wrote:

AtomicBawm3 wrote:


No, it's an object that sits on the outer edge of a circle.  I want to be able to drag it and have it go to the corresponding point on the circle.

Hmm... You mean to rotate the circle? Or to drag the circle? Or to drag the dot and have it stay in the radius of the circle?

last one.

I'm working on uploading a project for you. Hang on there for a minute or two.

Offline

 

#8 2010-06-22 21:33:27

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

coolstuff wrote:

AtomicBawm3 wrote:

coolstuff wrote:


Hmm... You mean to rotate the circle? Or to drag the circle? Or to drag the dot and have it stay in the radius of the circle?

last one.

I'm working on uploading a project for you. Hang on there for a minute or two.

Really? Thanks!


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#9 2010-06-22 21:36:26

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Math Q

La: http://scratch.mit.edu/projects/coolfixit/1144574. There you go  smile

It uses trigonometry, but I'm afraid there's no other way  smile

Offline

 

#10 2010-06-22 22:03:56

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

That's okay, I understand it.  Actually now I have another problem.  Here's the project I'm working on, but it's not exactly working right and I can't figure it out. yeah...


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#11 2010-06-22 22:06:02

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Math Q

AtomicBawm3 wrote:

That's okay, I understand it.  Actually now I have another problem.  Here's the project I'm working on, but it's not exactly working right and I can't figure it out. yeah...

It seems to be working fine for me...  hmm

Offline

 

#12 2010-06-22 22:07:14

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

coolstuff wrote:

AtomicBawm3 wrote:

That's okay, I understand it.  Actually now I have another problem.  Here's the project I'm working on, but it's not exactly working right and I can't figure it out. yeah...

It seems to be working fine for me...  hmm

If you drag the planet and then try it dragging it to the left, it messes up slightly, then if you drag it to the right, it jumps back to somewhere in between.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#13 2010-06-22 22:12:17

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Math Q

AtomicBawm3 wrote:

coolstuff wrote:

AtomicBawm3 wrote:

That's okay, I understand it.  Actually now I have another problem.  Here's the project I'm working on, but it's not exactly working right and I can't figure it out. yeah...

It seems to be working fine for me...  hmm

If you drag the planet and then try it dragging it to the left, it messes up slightly, then if you drag it to the right, it jumps back to somewhere in between.

That is strange... What I've found is that if you drag it to the left and then to the right, it actually disappears completely! I'm not entirely sure how to fix that predicament...

Offline

 

#14 2010-06-22 22:13:31

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

Well, the disappearing thing is cuz it hides when it's touching the edge...


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#15 2010-06-22 22:15:45

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Math Q

AtomicBawm3 wrote:

Well, the disappearing thing is cuz it hides when it's touching the edge...

Oh, I see then.

It could be because there's different formulas for X and Y positions for when the mouse is down and for when it's not.

Offline

 

#16 2010-06-22 22:19:11

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

coolstuff wrote:

AtomicBawm3 wrote:

Well, the disappearing thing is cuz it hides when it's touching the edge...

Oh, I see then.

It could be because there's different formulas for X and Y positions for when the mouse is down and for when it's not.

What do you mean?  It only needs to move when the mouse is down and it does fine when the planet is rotated.  It only messes up after the planet is rotated and then you try to drag it.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#17 2010-06-22 22:24:38

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Math Q

AtomicBawm3 wrote:

coolstuff wrote:

AtomicBawm3 wrote:

Well, the disappearing thing is cuz it hides when it's touching the edge...

Oh, I see then.

It could be because there's different formulas for X and Y positions for when the mouse is down and for when it's not.

What do you mean?  It only needs to move when the mouse is down and it does fine when the planet is rotated.  It only messes up after the planet is rotated and then you try to drag it.

Maybe you and I are thinking of different things.

Still, I'm having some difficulties with the hiding sign... Not only does it hide when it hits the edge, but it also hides for no apparently reason when I drag it...

Offline

 

#18 2010-06-22 22:28:06

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

coolstuff wrote:

AtomicBawm3 wrote:

coolstuff wrote:

Oh, I see then.

It could be because there's different formulas for X and Y positions for when the mouse is down and for when it's not.

What do you mean?  It only needs to move when the mouse is down and it does fine when the planet is rotated.  It only messes up after the planet is rotated and then you try to drag it.

Maybe you and I are thinking of different things.

Still, I'm having some difficulties with the hiding sign... Not only does it hide when it hits the edge, but it also hides for no apparently reason when I drag it...

Really?  You mean after you drop it?  Cuz that's the positioning problem at work...
Ok, now it no longer hides when touching the edge.

Last edited by AtomicBawm3 (2010-06-22 22:31:33)


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#19 2010-06-22 22:30:49

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Math Q

AtomicBawm3 wrote:

coolstuff wrote:

AtomicBawm3 wrote:


What do you mean?  It only needs to move when the mouse is down and it does fine when the planet is rotated.  It only messes up after the planet is rotated and then you try to drag it.

Maybe you and I are thinking of different things.

Still, I'm having some difficulties with the hiding sign... Not only does it hide when it hits the edge, but it also hides for no apparently reason when I drag it...

Really?  You mean after you drop it?  Cuz that's the positioning problem at work...

Yeah, I move it left, I move it right, it disappears after the mouse is down.

I can remake the project exactly as you made it but with better scripting tomorrow, if you'd like. Guaranteed bug-free. I don't really like looking through other people's scripting, though...

Offline

 

#20 2010-06-22 22:33:33

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

coolstuff wrote:

AtomicBawm3 wrote:

coolstuff wrote:


Maybe you and I are thinking of different things.

Still, I'm having some difficulties with the hiding sign... Not only does it hide when it hits the edge, but it also hides for no apparently reason when I drag it...

Really?  You mean after you drop it?  Cuz that's the positioning problem at work...

Yeah, I move it left, I move it right, it disappears after the mouse is down.

I can remake the project exactly as you made it but with better scripting tomorrow, if you'd like. Guaranteed bug-free. I don't really like looking through other people's scripting, though...

I fixed the hiding thing, now it's just the jumping side to side...


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#21 2010-06-22 22:35:55

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Math Q

AtomicBawm3 wrote:

coolstuff wrote:

AtomicBawm3 wrote:


Really?  You mean after you drop it?  Cuz that's the positioning problem at work...

Yeah, I move it left, I move it right, it disappears after the mouse is down.

I can remake the project exactly as you made it but with better scripting tomorrow, if you'd like. Guaranteed bug-free. I don't really like looking through other people's scripting, though...

I fixed the hiding thing, now it's just the jumping side to side...

Well, I can help more tomorrow, but I'm going to have to turn in for the night.

Good luck with your project!

Offline

 

#22 2010-06-23 10:53:13

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

coolstuff wrote:

AtomicBawm3 wrote:

coolstuff wrote:


Yeah, I move it left, I move it right, it disappears after the mouse is down.

I can remake the project exactly as you made it but with better scripting tomorrow, if you'd like. Guaranteed bug-free. I don't really like looking through other people's scripting, though...

I fixed the hiding thing, now it's just the jumping side to side...

Well, I can help more tomorrow, but I'm going to have to turn in for the night.

Good luck with your project!

Thanks and Thanks.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#23 2010-06-23 12:38:29

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

There's something off with the sign, cuz I'm trying it now and I took out the turn the planet thing and it's still jumping around.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#24 2010-06-23 12:41:32

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Math Q

wait I think I got it...

YEESSS! I got it!

Last edited by AtomicBawm3 (2010-06-23 12:58:42)


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

Board footer