Package ponkOut

Source Code of ponkOut.Map

/* Copyright 2010, 2012 Christian Matt
*
* This file is part of PonkOut.
*
* PonkOut is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PonkOut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PonkOut.  If not, see <http://www.gnu.org/licenses/>.
*/

package ponkOut;

import org.lwjgl.util.vector.Vector2f;

import ponkOut.graphics.GraphicsObjectsManager;
import ponkOut.logic.Block;
import ponkOut.logic.GameBall;
import ponkOut.logic.Paddle;
import ponkOut.logic.PlayerPaddle;
import ponkOut.logic.WallBall;
import ponkOut.logic.WallPaddle;

public class Map {
  public Map(GraphicsObjectsManager goManager) {
    new WallBall(WallBall.Place.TOP_LEFT, goManager);
    new WallBall(WallBall.Place.TOP_RIGHT, goManager);
    new WallBall(WallBall.Place.BOTTOM_LEFT, goManager);
    new WallBall(WallBall.Place.BOTTOM_RIGHT, goManager);

    new WallPaddle(Paddle.Place.RIGHT, goManager);
    new WallPaddle(Paddle.Place.TOP, goManager);

    PlayerPaddle p1 = new PlayerPaddle(0, Paddle.Place.BOTTOM, goManager);
    PlayerPaddle p2 = new PlayerPaddle(1, Paddle.Place.LEFT, goManager);
    new GameBall(p1, goManager);
    new GameBall(p2, goManager);

    new GameBall(new Vector2f(9.0f, 9.0f), 0.5f, goManager);

    for (int i = -5; i <= 4; ++i)
      for (int j = -5; j <= 4 && i + j <= 6 && (i + j <= 5 || i == 4 || j == 4); ++j)
        new Block(new Vector2f(5.0f + i, 5.0f + j), 1.0f, 1.0f, goManager);
  }
}
TOP

Related Classes of ponkOut.Map

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.