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

#1 2011-02-17 18:02:49

coupdegrace
Scratcher
Registered: 2009-12-02
Posts: 42

Pendulum help.

Forgive me if this
a) does not belong in advanced topics.
b) is n00bish.
or
c) all of the above.

I've been working on this trigonometry pendulum type thing, and I've been getting some glitches.
http://scratch.mit.edu/projects/coupdegrace/1602685
You are supposed to be able to swing the pendulum different speeds with your mouse. But if you swing it in one direction, it "bounces". I've tried testing for negatives, absolute value, etc.
I need help.
Thank you in advance.

Last edited by coupdegrace (2011-02-17 18:04:50)


[CENTER]http://www.nodiatis.com/pub/11.jpg[/CENTER]

Offline

 

#2 2011-02-18 14:30:38

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Pendulum help.

It looks fine to me...


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#3 2011-02-18 14:51:08

floppy_gunk
Scratcher
Registered: 2008-11-14
Posts: 500+

Re: Pendulum help.

If it's going in the opposite direction when in the top-left corner, reverse the direction when when in the top-left corner.
[blocks]
<if><< <( <direction> <>> -90 )> <and> <( <direction> <<> 0 )> >>
<set{ TurnVel.  }to( (( <{ speed  }> <*> -0.3 ))
<else>
<set{ TurnVel.  }to( (( <{ speed  }> <*> 0.3 ))
<end>
[/blocks]

Problem solved.

Last edited by floppy_gunk (2011-02-18 14:57:25)


http://img163.imageshack.us/img163/1917/2856lg.jpg Get it now!  smile

Offline

 

Board footer