コード例 #1
0
 public void paintComponent(Graphics2D g) {
   super.paint(g);
   Tile.paintMap(g);
   Player.draw(g);
   GamePlayer.paintPlayers(g);
   Item.paint(g);
 }
コード例 #2
0
  public Game() {
    super("Game");
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    this.setSize(width, height);
    this.setVisible(true);
    this.addKeyListener(this);
    this.addMouseMotionListener(this);
    this.setLocationRelativeTo(null);
    this.addMouseListener(this);

    new repaint().start();
    new GameController().start();
    new MotionHandler().start();
    new Multiplayer();

    Item.addItem("grass", 10);
    Item.addItem("tree", 10);
    // this.setComponentOrientation(null);

  }
コード例 #3
0
 @Override
 public void mousePressed(MouseEvent e) {
   Item.action(e.getX() - Player.xCam, e.getY() - Player.yCam);
 }