SHARE
TWEET

Untitled

a guest Oct 18th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pkg.*;
  2. public class starter implements InputControl, InputKeyControl
  3. {
  4.         static Rectangle jose;
  5.         static Text word;
  6.  
  7.         public static void main(String args[])
  8.         {
  9.        
  10.             // following line is necessary for onMouseClick, don't change
  11.             MouseController mC = new MouseController(Canvas.getInstance(),new starter());
  12.            
  13.             // please leave following line alone, necessary for keyboard input
  14.             KeyController kC = new KeyController(Canvas.getInstance(),new starter());
  15.            
  16.             int will = 10;
  17.             jose = new Rectangle(10,20,100,200);
  18.             jose.draw();
  19.             word = new Text (will + 40,50, "dylan");
  20.             word.draw();
  21.             int count = 0;
  22.            
  23.             while(true){
  24.                
  25.             Canvas.pause(15);
  26.             count++;
  27.             jose.translate(2,0);
  28.             word.translate(2,0);
  29.             if(count>300){
  30.             count = count -300;
  31.             jose.translate(-600,0);
  32.             word.translate(-600,0);
  33.             }
  34.         }
  35.        
  36.    
  37.         }
  38.        
  39.         public void onMouseClick(double x, double y){
  40.             // and/or here
  41.    
  42.         }
  43.        
  44.         public void keyPress(String s)
  45.         {
  46.             // temp holds the enter character
  47.            
  48.             char done = (char)10;
  49.             String temp = Character.toString(done);
  50.            
  51.         }
  52. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top