This site requires JavaScript, please enable it in your browser!
Greenfoot back
mikeyboy
mikeyboy wrote ...

2013/3/8

Can someone help me with this?

mikeyboy mikeyboy

2013/3/8

#
http://www.greenfoot.org/scenarios/4033 ... This is the application I am having trouble with. I am trying to find a way of incorporating a damping effect so that the pendulum will slow down and eventually stop, also I would like it to start swinging at a predefined place rather than having to be dragged (even though I have modified it I still need to drag the ball to get it to start) However I have a limited knowledge with Java and so far have only managed to get this far : http://www.greenfoot.org/scenarios/7639
mikeyboy mikeyboy

2013/3/8

#
My code can be found here : http://www.greenfoot.org/scenarios/7640 ... I forgot to publish it with that one
danpost danpost

2013/3/8

#
One way to work it would be to use the mouse such that if a mouse button is pressed (mousePressed), then the pendulum is set to its starting position; and if the mouse button is released (mouseClicked), then the pendulum is allowed to swing. The mouse actions do not even have to occur on the pendulum itself. BTW, you can update a scenario you have uploaded onto the site by re-sharing it. Just use the same Title name.
You need to login to post a reply.