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

2016/10/22

Need Help in designing a weight balance.

Shrey007 Shrey007

2016/10/22

#
I want to develop a simple weight balance using Greenfoot. I am new to greenfoot and have no idea how to develop one. Scenario: There will be different balls with numbers 1,2,3,4,5,6. When user places 1 and 2 on weight balance pan, weight balance should tilt and show which ball is heavier.
danpost danpost

2016/10/22

#
Start by creating the Actor subclasses needed for the project (the rocker arm and pan classes). If you want the weight balance to tilt gradually to any new setting (or settle into the new setting by swaying back and forth over what will be the new setting), then you may require a smooth rotating system. The class for the rocker arm should keep a reference to the two pans attached to it so it can easily acquire the weight values and determine what rotational forces that need applied. A slight drag factor should also be implemented to create the settling on a new value. This was just to give you an idea of where to start and what may be involved.
You need to login to post a reply.