Package controller

Source Code of controller.Game

package controller;

import java.awt.Color;
import java.util.ArrayList;

import view.ScoreBoard;
import view.Window;
import model.Config;
import model.Snake;

public class Game implements Config {
 
  private Window window;
  private ScoreBoard scoreBoard;
 
  private ArrayList<Snake> players; 
  private ArrayList<Integer> scores;
 
 
  public Game(ArrayList<Snake> players, Window window) {
    this.players = players;
    this.window = window;
   
    scores = new ArrayList<Integer>();
    for ( Snake player : players ) {
      scores.add(0);
    }
   
    scoreBoard = new ScoreBoard(players);
    window.addToControlPanel(scoreBoard);
  }
 
 
  public void playRound() {
    Round round = new Round(players, window);
    round.playRound();
  }
 

}
TOP

Related Classes of controller.Game

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.