Skóre 2

Ciele
  1. Zobrazenie skóre
  2. Entity, prvky GUI
Úvod
    V tomto cvičeni implementujeme nový kontajner entít - teda nový screen zobrazujúci skóre v prípade prehry
Postup
  1. Úloha: Vytvorte novuú triedu - entity container GameOverScreen
    Úloha: Implementujte rozhrania IEntityContainer, Screen, ApplicationContextAware
    Poznámka: Nezabudnite vytvoriť bean v applicationContext.xml
    Úloha: Implementujte inicializačnú metódu
    • Vytvorte Label, v ktorom sa bude skóre vypisovať
      
                              Label.LabelStyle labelStyle = new Label.LabelStyle();
                              labelStyle.font = new BitmapFont();
                              scores = new Label(".........",labelStyle);
                          
    • Implementujte metódu show()
      Poznámka: Napríklad pomocou formatera alebo string buildera pripravte tabuľku, ktorú ako text nasetujte do vytvoreného labela
      
                              scores.setText(builder);
                          
    • Poznámka: nezabudnite pridať label do Stage-u aby sa vykresľoval
      Poznámka: po určitom čase nastavte screen naspäť na hrací screen a reštartujte hracie pole
    Úloha: Pred každým zobrazením skóre uložte aktualne nahraté skóre
comments powered by Disqus