diff --git a/android/assets/font/the-next-font.fnt b/android/assets/font/the-next-font.fnt new file mode 100644 index 0000000..b58120b --- /dev/null +++ b/android/assets/font/the-next-font.fnt @@ -0,0 +1,18 @@ +info face="TheNextFont" size=64 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2 +common lineHeight=65 base=48 scaleW=128 scaleH=256 pages=1 packed=0 +page id=0 file="the-next-font.png" +chars count=13 +char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=47 xadvance=12 page=0 chnl=0 +char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=47 xadvance=12 page=0 chnl=0 +char id=43 x=35 y=148 width=29 height=29 xoffset=2 yoffset=10 xadvance=33 page=0 chnl=0 +char id=48 x=35 y=0 width=49 height=49 xoffset=2 yoffset=0 xadvance=53 page=0 chnl=0 +char id=49 x=84 y=0 width=20 height=49 xoffset=2 yoffset=0 xadvance=23 page=0 chnl=0 +char id=50 x=0 y=50 width=34 height=49 xoffset=2 yoffset=0 xadvance=37 page=0 chnl=0 +char id=51 x=34 y=50 width=34 height=49 xoffset=2 yoffset=0 xadvance=38 page=0 chnl=0 +char id=52 x=68 y=50 width=34 height=49 xoffset=1 yoffset=0 xadvance=36 page=0 chnl=0 +char id=53 x=0 y=99 width=35 height=49 xoffset=2 yoffset=0 xadvance=39 page=0 chnl=0 +char id=54 x=35 y=99 width=35 height=49 xoffset=2 yoffset=0 xadvance=39 page=0 chnl=0 +char id=55 x=70 y=99 width=33 height=49 xoffset=2 yoffset=0 xadvance=37 page=0 chnl=0 +char id=56 x=0 y=0 width=35 height=50 xoffset=2 yoffset=-1 xadvance=39 page=0 chnl=0 +char id=57 x=0 y=148 width=35 height=49 xoffset=2 yoffset=0 xadvance=39 page=0 chnl=0 +kernings count=0 diff --git a/android/assets/font/the-next-font.png b/android/assets/font/the-next-font.png new file mode 100644 index 0000000..09e7bb5 Binary files /dev/null and b/android/assets/font/the-next-font.png differ diff --git a/android/assets/themes/dark.theme b/android/assets/themes/dark.theme index d93e47f..654e204 100644 --- a/android/assets/themes/dark.theme +++ b/android/assets/themes/dark.theme @@ -17,6 +17,7 @@ ], "current_score": "c83737ff", "high_score": "d400aaff", + "bonus": "e3e3e3ff", "band": "2b5ccfff" }, "cell_texture": "basic.png" diff --git a/android/assets/themes/default.theme b/android/assets/themes/default.theme index 968c314..b68ac41 100644 --- a/android/assets/themes/default.theme +++ b/android/assets/themes/default.theme @@ -17,6 +17,7 @@ ], "current_score": "ffcc00ff", "high_score": "65d681ff", + "bonus": "4d4d4dff", "band": "87ceebff" }, "cell_texture": "basic.png" diff --git a/core/src/io/github/lonamiwebs/klooni/Klooni.java b/core/src/io/github/lonamiwebs/klooni/Klooni.java index 89464fe..ee8754e 100644 --- a/core/src/io/github/lonamiwebs/klooni/Klooni.java +++ b/core/src/io/github/lonamiwebs/klooni/Klooni.java @@ -57,6 +57,7 @@ public class Klooni extends Game { skin.add("font", new BitmapFont(Gdx.files.internal("font/geosans-light.fnt"))); skin.add("font_small", new BitmapFont(Gdx.files.internal("font/geosans-light32.fnt"))); + skin.add("font_bonus", new BitmapFont(Gdx.files.internal("font/the-next-font.fnt"))); // Use only one instance for the theme, so anyone using it uses the most up-to-date Theme.skin = skin; // Not the best idea diff --git a/core/src/io/github/lonamiwebs/klooni/Theme.java b/core/src/io/github/lonamiwebs/klooni/Theme.java index 3502e52..ebcc53e 100644 --- a/core/src/io/github/lonamiwebs/klooni/Theme.java +++ b/core/src/io/github/lonamiwebs/klooni/Theme.java @@ -27,6 +27,7 @@ public class Theme { public Color currentScore; public Color highScore; + public Color bonus; public Color bandColor; private Color[] cells; @@ -109,6 +110,7 @@ public class Theme { currentScore = new Color((int)Long.parseLong(colors.getString("current_score"), 16)); highScore = new Color((int)Long.parseLong(colors.getString("high_score"), 16)); + bonus = new Color((int)Long.parseLong(colors.getString("bonus"), 16)); bandColor = new Color((int)Long.parseLong(colors.getString("band"), 16)); emptyCell = new Color((int)Long.parseLong(colors.getString("empty_cell"), 16)); diff --git a/core/src/io/github/lonamiwebs/klooni/game/BonusParticle.java b/core/src/io/github/lonamiwebs/klooni/game/BonusParticle.java index 5dded47..80b1fc7 100644 --- a/core/src/io/github/lonamiwebs/klooni/game/BonusParticle.java +++ b/core/src/io/github/lonamiwebs/klooni/game/BonusParticle.java @@ -27,7 +27,7 @@ class BonusParticle { lifetime = 1f; // Render - label.setColor(Klooni.theme.highScore); + label.setColor(Klooni.theme.bonus); label.setFontScale(Interpolation.elasticOut.apply(0f, 1f, lifetime)); float opacity = Interpolation.linear.apply(1f, 0f, lifetime); label.draw(batch, opacity); diff --git a/core/src/io/github/lonamiwebs/klooni/game/BonusParticleHandler.java b/core/src/io/github/lonamiwebs/klooni/game/BonusParticleHandler.java index 12cbbc4..5e05251 100644 --- a/core/src/io/github/lonamiwebs/klooni/game/BonusParticleHandler.java +++ b/core/src/io/github/lonamiwebs/klooni/game/BonusParticleHandler.java @@ -7,13 +7,16 @@ import com.badlogic.gdx.utils.Array; import java.util.Iterator; +import io.github.lonamiwebs.klooni.Klooni; + public class BonusParticleHandler { private final Array particles; private final Label.LabelStyle labelStyle; - public BonusParticleHandler(final Label.LabelStyle style) { - labelStyle = style; + public BonusParticleHandler(final Klooni game) { + labelStyle = new Label.LabelStyle(); + labelStyle.font = game.skin.getFont("font_bonus"); particles = new Array(); } diff --git a/core/src/io/github/lonamiwebs/klooni/screens/GameScreen.java b/core/src/io/github/lonamiwebs/klooni/screens/GameScreen.java index a295744..b7aa2b2 100644 --- a/core/src/io/github/lonamiwebs/klooni/screens/GameScreen.java +++ b/core/src/io/github/lonamiwebs/klooni/screens/GameScreen.java @@ -8,7 +8,6 @@ import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.g2d.SpriteBatch; -import com.badlogic.gdx.scenes.scene2d.ui.Label; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -88,10 +87,7 @@ class GameScreen implements Screen, InputProcessor, BinSerializable { board = new Board(layout, BOARD_SIZE); holder = new PieceHolder(layout, HOLDER_PIECE_COUNT, board.cellSize); pauseMenu = new PauseMenuStage(layout, game, scorer, gameMode); - - Label.LabelStyle labelStyle = new Label.LabelStyle(); - labelStyle.font = game.skin.getFont("font"); - bonusParticleHandler = new BonusParticleHandler(labelStyle); + bonusParticleHandler = new BonusParticleHandler(game); gameOverSound = Gdx.audio.newSound(Gdx.files.internal("sound/game_over.mp3")); diff --git a/original-resources/generate_theme.py b/original-resources/generate_theme.py index 89f67ea..63dd770 100755 --- a/original-resources/generate_theme.py +++ b/original-resources/generate_theme.py @@ -27,6 +27,7 @@ template = '''{{ ], "current_score": "{current_score}", "high_score": "{high_score}", + "bonus": "{bonus}", "band": "{band}" }}, "cell_texture": "{cell_tex}" diff --git a/original-resources/theme.svg b/original-resources/theme.svg index 5c0d6c1..e287330 100644 --- a/original-resources/theme.svg +++ b/original-resources/theme.svg @@ -26,8 +26,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.69999999" - inkscape:cx="335.14124" - inkscape:cy="488.33979" + inkscape:cx="28.553825" + inkscape:cy="118.51475" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" @@ -197,7 +197,8 @@ id="tspan4189">"generate_theme.py" to create "out.theme" + style="fill:#e5e5e5;fill-opacity:1" + transform="translate(3.0304577,0)"> + + +