Package controller

Source Code of controller.Round

package controller;

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

import view.GameBoard;
import view.ScoreBoard;
import view.Window;

import model.Config;
import model.Coordinate;
import model.Snake;

public class Round implements Config {

  private Window window;
  private GameBoard gameBoard;
 
  private ArrayList<Snake> players;
 
  public Round(ArrayList<Snake> players , Window window) {
    this.players = players;
    this.window = window;
    gameBoard = new GameBoard();
    window.addToMainPanel(gameBoard);
  }
 
 
  public void playRound() {
     
//    snake1 = new Snake(this,colors.get(0),randomizeStartCoordinates(),randomizeStartDirection());
   
  }
 
 
 
  private Coordinate randomizeStartCoordinates() {
    return new Coordinate(   (int)( Math.random() * GAME_BOARD_WIDTH) ,
                (int)( Math.random() * GAME_BOARD_HEIGHT ) );
  }
 
 
  private double randomizeStartDirection() {
    return Math.random() * ( 2 * Math.PI );
  }

 
 
}
TOP

Related Classes of controller.Round

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.