Exemplo n.º 1
0
	public Monster(MainGame game, Wave wave, int startHitPoints, float speed,
			int value, String textureFile, int columnCount, int spriteCount,
			int spriteHeight, int spriteWidth) {
		super(game, textureFile, new Vector2f(1f, 200f), columnCount,
				spriteCount, spriteWidth, spriteHeight, 1f);
		Vector2f startPoint = game.getGameplayScreen().getLevelSettings()
				.getStartPoint().cpy();

		this.setGridPosition(new Vector2f(startPoint.x, MathUtils
				.nextInt(-1, 2) + startPoint.y));
		this.Init(game, wave, value, startHitPoints, speed);
	}
Exemplo n.º 2
0
	public Monster(MainGame game, Wave wave, int startHitPoints, float speed,
			int value, String textureFile, int columnCount, int spriteCount,
			int spriteHeight, int spriteWidth, Vector2f gridPosition) {
		super(game, textureFile, new Vector2f(1f, 200f), columnCount,
				spriteCount, spriteWidth, spriteHeight, 1f);
		if (((gridPosition.x < 2) || (gridPosition.x > 0x10))
				|| ((gridPosition.y < 0) || (gridPosition.y > 0x12))) {
			throw new RuntimeException("gridPosition is out of bounds.");
		}
		if (game.getGameplayScreen().getDirs()[gridPosition.x()][gridPosition
				.y()] == null) {
			throw new RuntimeException("gridPosition is not valid.");
		}
		this.setGridPosition(gridPosition);
		this.Init(game, wave, value, startHitPoints, speed);
	}