Advertisement
G-Rath

GameManager

Mar 14th, 2014
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. import java.awt.Graphics;
  2. import java.awt.Graphics2D;
  3. import javax.swing.JFrame;
  4. import javax.swing.JPanel;
  5. import javax.swing.SwingUtilities;
  6.  
  7. import java.awt.EventQueue;
  8.  
  9. public class GameManager
  10. {
  11.     /**
  12.      * Constructor for objects of class GameManager
  13.      */
  14.     public GameManager()
  15.     {
  16.     }
  17.  
  18.     public static void main( String[] args )
  19.     {
  20.         for (String s: args) {
  21.             System.out.println( s );
  22.         }
  23.  
  24.         //Note - this calls EventQueue.invokeLater and hence the two are interchangeable
  25.         SwingUtilities.invokeLater( new Runnable()
  26.             {
  27.  
  28.                 @Override
  29.                 public void run()
  30.                 {
  31.                     //Cretae a new skeleton which acts as the base for the rest of our drawings
  32.                     Skeleton sk = new Skeleton();
  33.                     sk.setVisible( true );
  34.                    
  35.                     //Create a new keyManager to listen for key events on Skeleton
  36.                     KeyManager keyMan = new KeyManager( sk );
  37.                     sk.addKeyListener( keyMan );
  38.  
  39.                 }
  40.             });
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement