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

Report as inappropriate.

mjrb4
mjrb4 presents ...

2009/2/15

Rotation demo

This code is a demo for the rotator class that enables actors to rotate around a specific point on screen. In this demo, the robot rotates around a ball that can be dragged anywhere.

Source code is avilable, along with a fairly detailed commentary of the maths behind the positioning, so if you're interested in how it's done you should be able to follow - nothing hideously complicated though you do need to use the sine rule.

I've felt the need for a method like this in a few scenarios so if others have as well, hope this helps.

If you just want the Rotator.java file, visit the web site link.

10573 views / 31 in the last 7 days

4 votes | 0 in the last 7 days

Tags: demo with-source rotation

This scenario is a member of: Reusable actors & support classes


open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on Tue Feb 17 00:36:03 UTC 2009

Want to leave a comment? You must first log in.

Who likes this?

FlyingRabidUnicornPig Game/maniac -nic- Moritz