Package view.objects.items
Class PowerUpView
Rappresenta la visualizzazione di un potenziamento nel gioco.
Questa classe gestisce l'aggiornamento e il disegno dei potenziamenti.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private int
private int
private int
private int
Fields inherited from class view.objects.CustomObjectView
aniIndex, aniTick, objectModel, playedPickupSound, spriteIndex, sprites
-
Constructor Summary
ConstructorsConstructorDescriptionPowerUpView
(PowerUpModel powerUpModel, BufferedImage[][] sprites) Costruttore per inizializzare un PowerUpView. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Disegna il potenziamento.private void
Disegna il punteggio associato al potenziamentoint
int
protected int
Restituisce il numero di sprite disponibili per il potenziamento.private void
Imposta gli offset per il disegno del potenziamento in base al suo tipo.void
update()
Aggiorna lo stato del potenziamento.Methods inherited from class view.objects.CustomObjectView
getObjectModel, playPickupSound, resetAniTick, updateAnimationTick
-
Field Details
-
Constructor Details
-
Method Details
-
update
public void update()Aggiorna lo stato del potenziamento. Se il potenziamento รจ stato raccolto, aumenta il contatore del punteggio. -
draw
Disegna il potenziamento.- Overrides:
draw
in classCustomObjectView<PowerUpModel>
- Parameters:
g
-
-
getSpriteAmount
protected int getSpriteAmount()Restituisce il numero di sprite disponibili per il potenziamento. Sempre 1 dato che non ci sono animazioni- Specified by:
getSpriteAmount
in classCustomObjectView<PowerUpModel>
- Returns:
- Il numero di sprite disponibili.
-
setDrawOffset
private void setDrawOffset()Imposta gli offset per il disegno del potenziamento in base al suo tipo. -
drawPoints
-
getPowerUpModel
-
getPointsDuration
public int getPointsDuration() -
getPointsTick
public int getPointsTick()
-