| ScaledXJRobo.java |
1 // ScaledJRobo Adds scaling to basic JRobo class.
2 // also changes rect implementation !badly!
3 // and adds circle
4 // Author: David 5/9/99
5
6 import java.awt.*;
7
8 public class ScaledXJRobo extends XJRobo
9 {
10 // properties
11 double scale;
12
13 // constructor
14 ScaledXJRobo( Graphics g )
15 {
16 super( g );
17 scale = 1;
18 }
19
20 public void setScale( double newScale )
21 {
22 scale = newScale;
23 }
24
25 // f - Move forward scaled distance; overrides f in JRobo!
26 public void f( int distance )
27 {
28 super.f( ( int ) Math.round( distance * scale ) );
29 }
30
31 } // end ScaledXJRobo class
32