game.score
Class CScoreManager

java.lang.Object
  extended by game.physics.CStaticShape
      extended by game.score.CScoreManager
All Implemented Interfaces:
IGraphicObject

public class CScoreManager
extends CStaticShape
implements IGraphicObject

Contains the core of the scoring system.
Manages multiple hits and the multiplier.

Author:
sroccaserra

Field Summary
private  java.awt.Color m_badFlashColor
           
private  java.awt.Color m_color
           
private  java.awt.Color m_goodFlashColor
           
private  int m_increment
           
private  float m_incrementTextLife
           
private  boolean m_isFreezed
           
private  float m_multiplier
           
private  int m_nbContinue
           
private  int m_nbFlash
           
private  int m_score
           
static int MAX_MULTIPLIER
           
private static int OFFSET
           
static float SHOW_INCREMENT_TIME
           
 
Fields inherited from class game.physics.CStaticShape
m_box, m_gameDisplay, m_isHidden
 
Constructor Summary
CScoreManager(IGameDisplay gameScreen)
           
 
Method Summary
 void animate(float dt)
          Animates the multiplier.
private  void checkMultiplier()
           
 void draw(java.awt.Graphics g)
           
private  void drawMultiplierBar(java.awt.Graphics g, int x, int y)
          Self-explanatory.
 void freeze()
          Freezes the score related variables, such as the score and the multiplier.
 int getIncrement()
           
 float getMultiplier()
           
 int getRoundedMultiplier()
           
 int getScore()
           
 void hit(int nbHits, boolean bUpdateMultiplier)
           
 void miss()
           
 void reset()
           
 java.lang.String toString()
           
 void useContinue()
           
 
Methods inherited from class game.physics.CStaticShape
cycle, drawBox, getCenter, getVelocity, hide, intersect, isHidden, show
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface game.graphics.IGraphicObject
cycle, getCenter, getVelocity, intersect
 

Field Detail

MAX_MULTIPLIER

public static final int MAX_MULTIPLIER
See Also:
Constant Field Values

SHOW_INCREMENT_TIME

public static final float SHOW_INCREMENT_TIME
See Also:
Constant Field Values

OFFSET

private static final int OFFSET
See Also:
Constant Field Values

m_score

private int m_score

m_increment

private int m_increment

m_multiplier

private float m_multiplier

m_nbContinue

private int m_nbContinue

m_color

private final java.awt.Color m_color

m_nbFlash

private int m_nbFlash

m_goodFlashColor

private final java.awt.Color m_goodFlashColor

m_badFlashColor

private final java.awt.Color m_badFlashColor

m_isFreezed

private boolean m_isFreezed

m_incrementTextLife

private float m_incrementTextLife
Constructor Detail

CScoreManager

public CScoreManager(IGameDisplay gameScreen)
Method Detail

getScore

public final int getScore()

getIncrement

public final int getIncrement()

reset

public final void reset()

hit

public final void hit(int nbHits,
                      boolean bUpdateMultiplier)

miss

public final void miss()

useContinue

public final void useContinue()

freeze

public final void freeze()
Freezes the score related variables, such as the score and the multiplier.


checkMultiplier

private final void checkMultiplier()

getMultiplier

public final float getMultiplier()

getRoundedMultiplier

public final int getRoundedMultiplier()

animate

public final void animate(float dt)
Animates the multiplier.

Specified by:
animate in interface IGraphicObject
Overrides:
animate in class CStaticShape

draw

public final void draw(java.awt.Graphics g)
Specified by:
draw in interface IGraphicObject

drawMultiplierBar

private void drawMultiplierBar(java.awt.Graphics g,
                               int x,
                               int y)
Self-explanatory.

Parameters:
g -
x -
y -

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object