Day 19: Daily Challenge and Missions
Daily challenge is to collect 5 letter which fly like powerups do. Once you collect them all, you get some coins to buy powerups. This is a way to get easy free coins just by playing the game. I was inspired by Subway Surfers when creating this.
Missions are various tasks for player to complete to earn coins. Coins are used to buy upgrades and expendable items like shields, bombs, etc. Missions come in sets of three, and you need to complete all three tasks to earn the reward.
For the missions I figured that it would be easiest to use the builtin multiline text wrapping. However, the line height is too big, and I couldn't find a way to reduce it. At least, not from code. Then I edited the .fnt file generated by BMFont and just changed
lineHeight=33
to
lineHeight=23
I added 5 pixels of drop shadow around all letters after the bitmap was generated initially, so I'm now reducing height by ten (5 pixels above, and 5 below the glyph).
While searching the docs for this, I found something else I missed before: Depending on the font you choose for the game, numbers might not look very nice as glyph for digit "one" can we very slim, and numbers like 11 look odd. To solve this, you can fix some of the glyphs in the font to use fixed width:
font.setFixedWidthGlyphs("0123456789");
This looks really good, but I already did some design decisions that used the slim-glyphs "feature", so I'm not going to use this.
read more... Tweet to @bigosaur Tweet Bigosaur, 2013-10-18