/** * A class which is consulted by the FXStudio: * it helps advise *where* to draw things on the screen. * * @author ITEC 120 class, in unison. * @version 2007.Aug.20 */ class RocketScientist { /** Calculate The height of a UFO, at a given moment, for the opening * scene -- taking off from the secret base. * * @param frameNum The frame number (0 is first frame; 24frames per second) * @return The y-coordinate for the ufo, at the desired frame. */ static int ufoHeightAt(int frameNum) { return 400 - 102 - frameNum -82; } /** Run some tests, to see if ufoHeight gives the expected answers. */ static void testRocketScientist() { System.out.println( "Height of ufo at frame 0 is " + ufoHeightAt(0) ); System.out.println( "Expected: 216" ); System.out.println( "Height of ufo at frame 1 is " + ufoHeightAt(1) ); System.out.println( "Expected: 215" ); System.out.println( "Height of ufo at frame 73 is " + ufoHeightAt(73) ); System.out.println( "Expected: 143" ); } }