pl/mbogusz3/invaders/model/InvadersModel.java
/**
	 * Recalculate enemy actions (movement and shooting). Called from recalculate().
	 * @param frameTime frame time, in seconds.
	 */
Recalculate enemy actions (movement and shooting). Called from recalculate().
@param frameTime frame time, in seconds.
Recalculate enemy actions ( movement and shooting ) . Called from recalculate () . @param frameTime frame time in seconds .
private void recalculateEnemyActions(double frameTime) {
		if(this.enemy.isMoving()) {
			try {
				this.enemy.move(frameTime);
			} catch (InvadersGameEndException e) {
				this.isGameOver = true;
				this.isGameRunning = false;
			}
			this.hasChanged = true;
		}
		if(this.enemyProjectile == null) {
			this.enemyProjectile = this.enemy.shoot(frameTime);
		}
		if(this.enemyProjectile != null) {
			this.enemyProjectile.move(frameTime);
			if(this.enemyProjectile.isInvalid()) {
				this.enemyProjectile = null;
			}
			this.hasChanged = true;
		}
	}
private void recalculateEnemyActions ( double frameTime ) { if ( this . enemy . isMoving ( ) ) { try { this . enemy . move ( frameTime ) ; } catch ( InvadersGameEndException e ) { this . isGameOver = true ; this . isGameRunning = false ; } this . hasChanged = true ; } if ( this . enemyProjectile == null ) { this . enemyProjectile = this . enemy . shoot ( frameTime ) ; } if ( this . enemyProjectile != null ) { this . enemyProjectile . move ( frameTime ) ; if ( this . enemyProjectile . isInvalid ( ) ) { this . enemyProjectile = null ; } this . hasChanged = true ; } }
Recalculate enemy actions (movement and shooting).
Recalculate enemy actions ( movement and shooting ) .
// Enemy movement // Enemy shots