Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This program is meant to create a castle with the idea of overriding methods in subclasses
- public class Activity4Main implements Directions {
- public static void main(String[] args){
- World.readWorld("Lesson3World4.kwld");
- World.setDelay(20);
- World.setVisible();
- //Creates all the different types of robots and set them at specific positions
- WallBuilder garyWallOne = new WallBuilder(1,2,North, -1);
- WallBuilder garyWallTwo = new WallBuilder(1,10,North, -1);
- WindowBuilder garyWindowOne = new WindowBuilder(5,7,North, -1);
- WindowBuilder garyWindowTwo = new WindowBuilder(5,4,North, -1);
- RoofBuilder garyRoof = new RoofBuilder(5,1,North, -1);
- DoorBuilder garyDoor = new DoorBuilder(1,5,North, -1);
- //Runs build method that each robot sub class overrode
- garyWallOne.build();
- garyWallTwo.build();
- garyWindowOne.build();
- garyWindowTwo.build();
- garyRoof.build();
- garyDoor.build();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement