se.liu.student.kimgr905.tilegame.sprites
Class Boss.Boss1

java.lang.Object
  extended by se.liu.student.kimgr905.tilegame.sprites.Sprite
      extended by se.liu.student.kimgr905.tilegame.sprites.Ship
          extended by se.liu.student.kimgr905.tilegame.sprites.Boss
              extended by se.liu.student.kimgr905.tilegame.sprites.Boss.Boss1
Enclosing class:
Boss

public static final class Boss.Boss1
extends Boss

Boss1 Follows the player on the x-axis and also moves up and down. The follow speed changes.

Has 3 types of weapons: 1. Double cannnons that shoots constantly but at a fairly slow rate. 2. A lazer. 3. A cone-shaped, frontal attack here called AimedShot.


Nested Class Summary
 
Nested classes/interfaces inherited from class se.liu.student.kimgr905.tilegame.sprites.Boss
Boss.Boss1
 
Field Summary
private  float AIMED_DX_MAX
           
private  float AIMED_DX_MIN
           
private  float AIMED_DY_MAX
           
private  int AIMED_TIME
           
private  boolean aimedDirection
           
private  float aimedDx
           
private  float aimedDy
           
private  boolean aimedShot
           
private static float AWAKE_SPEED
           
private  boolean cannonLeft
           
private  boolean cannonRight
           
private  int CHANGE_BACK
           
private  int CHANGE_PATH
           
private  int counter
           
private  int DOUBLE_LEFT
           
private  int DOUBLE_RIGHT
           
private static float FOLLOW_SPEED_FAST
           
private static float FOLLOW_SPEED_SLOW
           
private  float followSpeed
           
private static int HIT_POINTS
           
private  boolean lazer
           
private  int LAZER_TIME
           
private  int PEACE_TIME
           
private  int shotCounter
           
static int SHOTPOS_XCENTER
          Center x shot position.
static int SHOTPOS_XLEFT
          Left x shot position.
static int SHOTPOS_XRIGHT
          Right x shot position.
static int SHOTPOS_Y
          Y shot position.
private static float SLEEP_SPEED
           
private  int weaponCounter
           
 
Fields inherited from class se.liu.student.kimgr905.tilegame.sprites.Sprite
anim, STATE_DEAD, STATE_EXPLODING, STATE_NORMAL, STATE_SHOOTING
 
Constructor Summary
Boss.Boss1(Animation normal, Animation exploding)
          Creates a new Boss1 with the specified animations.
 
Method Summary
 void changePath(Player player)
          Makes the boss follow the player and also changes it's y-velocity based on the status of counter.
 float getAimedDx()
          Returns the x-velocity of the aimed shot.
 float getAimedDy()
          Returns the x-velocity of the aimed shot.
 void hit()
          When the ship gets hit it loses a hitpoint.
 boolean isAimedShot()
          Returns if aimedShot is true or false.
 boolean isCannonLeft()
          Is cannonLeft true or false.
 boolean isCannonRight()
          Is cannonRight true or false.
 boolean isLazer()
          Is lazer true or false.
 void shoot()
          Updates the shooting status for this boss.
 void wakeUp()
          Awakens the ship.
 
Methods inherited from class se.liu.student.kimgr905.tilegame.sprites.Ship
changePath, clone, getHitPoints, isAwake, setHitPoints, setState, update
 
Methods inherited from class se.liu.student.kimgr905.tilegame.sprites.Sprite
getHeight, getImage, getState, getVelocityX, getVelocityY, getWidth, getX, getY, isAlive, setVelocityX, setVelocityY, setX, setY
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIT_POINTS

private static final int HIT_POINTS
See Also:
Constant Field Values

SLEEP_SPEED

private static final float SLEEP_SPEED
See Also:
Constant Field Values

AWAKE_SPEED

private static final float AWAKE_SPEED
See Also:
Constant Field Values

FOLLOW_SPEED_SLOW

private static final float FOLLOW_SPEED_SLOW
See Also:
Constant Field Values

FOLLOW_SPEED_FAST

private static final float FOLLOW_SPEED_FAST
See Also:
Constant Field Values

lazer

private boolean lazer

aimedShot

private boolean aimedShot

cannonLeft

private boolean cannonLeft

cannonRight

private boolean cannonRight

SHOTPOS_XLEFT

public static final int SHOTPOS_XLEFT
Left x shot position.

See Also:
Constant Field Values

SHOTPOS_XCENTER

public static final int SHOTPOS_XCENTER
Center x shot position.

See Also:
Constant Field Values

SHOTPOS_XRIGHT

public static final int SHOTPOS_XRIGHT
Right x shot position.

See Also:
Constant Field Values

SHOTPOS_Y

public static final int SHOTPOS_Y
Y shot position.

See Also:
Constant Field Values

CHANGE_PATH

private final int CHANGE_PATH
See Also:
Constant Field Values

CHANGE_BACK

private final int CHANGE_BACK
See Also:
Constant Field Values

followSpeed

private float followSpeed

counter

private int counter

weaponCounter

private int weaponCounter

LAZER_TIME

private final int LAZER_TIME
See Also:
Constant Field Values

AIMED_TIME

private final int AIMED_TIME
See Also:
Constant Field Values

PEACE_TIME

private final int PEACE_TIME
See Also:
Constant Field Values

shotCounter

private int shotCounter

DOUBLE_LEFT

private final int DOUBLE_LEFT
See Also:
Constant Field Values

DOUBLE_RIGHT

private final int DOUBLE_RIGHT
See Also:
Constant Field Values

aimedDx

private float aimedDx

aimedDy

private float aimedDy

AIMED_DX_MIN

private final float AIMED_DX_MIN
See Also:
Constant Field Values

AIMED_DY_MAX

private final float AIMED_DY_MAX
See Also:
Constant Field Values

AIMED_DX_MAX

private final float AIMED_DX_MAX
See Also:
Constant Field Values

aimedDirection

private boolean aimedDirection
Constructor Detail

Boss.Boss1

public Boss.Boss1(Animation normal,
                  Animation exploding)
Creates a new Boss1 with the specified animations.

Parameters:
normal - normal animation
exploding - exploding animation
Method Detail

changePath

public void changePath(Player player)
Makes the boss follow the player and also changes it's y-velocity based on the status of counter.

Overrides:
changePath in class Ship
Parameters:
player - the player

shoot

public void shoot()
Updates the shooting status for this boss.

AimedShot: Check documentation for more info.

Overrides:
shoot in class Ship

wakeUp

public void wakeUp()
Description copied from class: Ship
Awakens the ship.

Overrides:
wakeUp in class Ship

hit

public void hit()
Description copied from class: Ship
When the ship gets hit it loses a hitpoint.

Overrides:
hit in class Ship

isLazer

public boolean isLazer()
Is lazer true or false.

Returns:
lazer

isAimedShot

public boolean isAimedShot()
Returns if aimedShot is true or false.

Returns:
aimedShot

isCannonLeft

public boolean isCannonLeft()
Is cannonLeft true or false.

Returns:
cannonLeft

isCannonRight

public boolean isCannonRight()
Is cannonRight true or false.

Returns:
cannonRight

getAimedDx

public float getAimedDx()
Returns the x-velocity of the aimed shot.

Returns:
x-velocity of the aimed shot

getAimedDy

public float getAimedDy()
Returns the x-velocity of the aimed shot.

Returns:
x-velocity of the aimed shot