You can make your own font array. But if your library has its own font system you might not need to. I think this was before the Arduboy’s font system was standardised, or maybe the people making the game wanted a different (possibly smaller) font. Only the developers know.
In fairness, I think they were more concerned about making a fun game than they were about other people being able to understand their code. Not all open source projects are intended to be easily ‘hackable’. If the developers understood the code, that was all that mattered to them, it didn’t matter if other people could understand it.
Besides which, the more practised with coding you are, the easier it is to just pick code up, read it and understand what it’s doing. There’s a saying that “code is read more than it is written”. Usually that just means “keep your code readable”, but it also means people do actually read code more than they write it, whether it’s theirs or someone elses. Reading code is a skill, and all skills take practice.
If you’ve got an Arduboy that’s easy enough to do, you just plonk the array in a new sketch and write code to make it display the characters in order. Maybe even one of the sprite converters/editors would be able to draw it.
if(battleState == BATTLESTATE_ENEMYCHOICE && i == currentEnemyChoice) arduboy.drawBitmap(xPos + 5, 20, font, 5, 5, BLACK); ////////////// don't know what this does
That’s drawing a font character, so without knowing the font I can’t say for sure what it draws, but based on the code I’d guess
font is some kind of dot or triangle since the if-condition indicates this will only be used once. (i.e. it’s a selector, like you get on old-style game menus)
else arduboy.drawBitmap(xPos, (battleState == BATTLESTATE_PLAYERDAMAGING && i == currentEnemyTurn)?22:26, enemyBitmaps[currentEnemies[i]], 16, 16, BLACK);
Is definitely drawing enemies on the screen. The enemy bitmaps don’t store the size, the size is actually written in the code, the
16, 16 part.
Nope, that’s not what the code says.
I’m not surprised to misread it though, the code is a bit messy.
continue; that only happens when that rather complex condition is met.
else before the draw call, which means that in every other case the enemies are being drawn.
Yes it could.
In fact the newer Arduboy library actually has a way to encode the image size in the bitmap itself.
Of course, you’d still have to calculate where you want to draw them (someone should suggest adding a ‘draw bitmap centred’ function), but it means you can call the draw function and it’ll draw the whole bitmap with the size stored with the bitmap.
Like I said before though, it depends on how your library works.
You might have to come up with your own system of storing the size with the bitmap, or calculating the size if you’ve got an 8 bit per pixel image (or 24 bit per pixel etc).