diff --git a/src/com/annimon/influencexxii/Score.java b/src/com/annimon/influencexxii/Score.java new file mode 100644 index 0000000..6d92972 --- /dev/null +++ b/src/com/annimon/influencexxii/Score.java @@ -0,0 +1,33 @@ +package com.annimon.influencexxii; + +import com.badlogic.gdx.graphics.g2d.BitmapFont; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; + +/** + * Score logic class + * @author aNNiMON + */ +public class Score { + + private static int killCount = 0; + private static int hiscore = 0; + + public static void reset() { + killCount = 0; + } + + public static void add() { + killCount++; + if (killCount > hiscore) { + hiscore = killCount; + } + } + + public static void draw(SpriteBatch batch, BitmapFont font) { + String text = "Score: " + killCount + " Hiscore: " + hiscore; + final float height = font.getCapHeight() + 2; + batch.begin(); + font.draw(batch, text, 10, height); + batch.end(); + } +} \ No newline at end of file