Foxglovz dev diary Part 2

When I started writing the Game Library, it was originally only a Graphics Library. The first thing I did was to get the Z88DK Devkit to display writing in fonts in the VZ’s hires MODE(1) graphics mode.
I was looking at a game sample and also playing around with a sprite editor called Spedito. I discovered that the format Spedito exports sprite data in can be used with the Z88DK to display monographic sprite data and could be programmed to display text fonts created in Spedito.
I set about writing Foxglovz which would draw text on the screen. It took a lot of learning as I have mostly written only a few basic programs in C over the years. The guys on the Z88DK forum were extremely helpful and patient with a newbie like me.
After some time I had it drawing text in any of the VZ colours and added on the ability to automatically draw an underline if required.

Writing text in MODE(1)

Originally all text was mono-spaced but I really wanted Foxglovz to be a bit more powerful, so added code to allow you to specify the width of each character. I also designed a font to go with it. You can download the font data file from my other site, BlueBilby.com

Since this code was written with the Z88DK’s built-in programming the font data should be able to be displayed on any computer which supports the Z88DK monographics drawing functions.

At this stage I decided to branch out and give Foxglovz more VZ-love and turned it into a Game Library. I added the ability to draw sprites quickly to the MODE(1) screen with code written in Z80 Assembly. I added a simple AABB collision function. I added in a scoring function so it can keep score in-game easily. And I added sprite animation support so you can control sprites on-screen.
You can also define a sprite as a oneShot animation which means it will play once, then disable the sprite. This is good for an explosion where you don’t want that sprite drawn again.

Sprite animation. The first sprite is set to a static one-image sprite. The next sprite is defined as animating forwards through 3 frames and jumping back to the first sprite. The last sprite animates frames forwards, then backwards.

I’m really enjoying making this all work and hope to incorporate all of this into a game I have been working on. More about that much, much later.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

88 + = 95

This site uses Akismet to reduce spam. Learn how your comment data is processed.