Advertisement
seby_stephens

Lesson 3 Activity 4 Constructicons Class

Nov 25th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. package Lesson3Activity4;
  2. import kareltherobot.UrRobot;
  3. import kareltherobot.World;
  4. //Basic elements that make up a constructicon
  5.  
  6. public class Constructicons extends UrRobot{
  7.     /**
  8.      * Constructor for constructicons class
  9.      * @param a
  10.      * @param s
  11.      * @param d
  12.      * @param b
  13.      * @ return - none
  14.      */
  15.     public Constructicons(int a,int s, Direction d, int b){
  16.         super(a,s,d,b);
  17.     }
  18.  
  19.     /**
  20.      * ALlows robot to turn right
  21.      * @ param - none
  22.      * @ return - void
  23.      */
  24.     public void turnRight(){
  25.         int delay = World.delay();
  26.         World.setDelay(0);
  27.         turnLeft();
  28.         turnLeft();
  29.         World.setDelay(delay);
  30.         turnLeft();
  31.     }
  32.  
  33.     /**
  34.      * Build method that other classes are overriding
  35.      * @ param - none
  36.      * @ return - void
  37.      */
  38.     public void build(){
  39.         turnOff();
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement