Advertisement
seby_stephens

Lesson 3 Activity 4

Nov 25th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. //This program is meant to create a castle with the idea of overriding methods in subclasses
  2. public class Activity4Main implements Directions {
  3.     public static void main(String[] args){
  4.         World.readWorld("Lesson3World4.kwld");
  5.         World.setDelay(20);
  6.         World.setVisible();
  7.         //Creates all the different types of robots and set them at specific positions
  8.         WallBuilder garyWallOne = new WallBuilder(1,2,North, -1);
  9.         WallBuilder garyWallTwo = new WallBuilder(1,10,North, -1);
  10.         WindowBuilder garyWindowOne = new WindowBuilder(5,7,North, -1);
  11.         WindowBuilder garyWindowTwo = new WindowBuilder(5,4,North, -1);
  12.         RoofBuilder garyRoof = new RoofBuilder(5,1,North, -1);
  13.         DoorBuilder garyDoor = new DoorBuilder(1,5,North, -1);
  14.  
  15.         //Runs build method that each robot sub class overrode
  16.         garyWallOne.build();
  17.         garyWallTwo.build();
  18.         garyWindowOne.build();
  19.         garyWindowTwo.build();
  20.         garyRoof.build();
  21.         garyDoor.build();
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement