Free Basic + Libraries! Everything works! Hurray!
I'm
continuing and finishing the thread with my own engine. It's for a game in the
Free Basic programming language, using various libraries to suit my needs. This
includes MP3 audio, PNG graphics, and True Type fonts with Russian language
support. This time, everything worked! I managed to get past the cycle of
problems. And everything works! Hurray! I'm so happy!
The thing
is, Free Basic doesn't have a number of built-in features. Like working with
PNG files, it can't read MP3 files, and so on. But you can always find a
third-party library. So, this is my first attempt at setting this up. And it
worked.
FreePng,
for working with PNG files. This is a 32-bit color depth. Transparent
backgrounds are enabled only through the ALPHA drawing mode. And not TRANS. I
spent a lot of time fiddling with this. I needed to enable the ALPHA mode.
I learned
how to scale images. The pixel magnification is exactly what I needed. No
anti-aliasing. Basically, we're writing our own zoom function. And we're
connecting it to image creation. Basically, we're scaling all the pixels,
turning them into larger squares. Drawing point-by-point. We're actually
transferring the image point-by-point.
I used the
FBSound library for sound. And everything worked right away. I learned how to
play sound. Everything was fine with the music file, too. But there was a small
issue with stream playback. There was a sharp sound at startup. I fixed that,
too. I switched from stream mode to just file playback. Everything worked. And
there are sounds. Like character movement or character sounds. And a musical
theme. Sound was the easiest part.
For
TrueType text, I used the FreeType library. Fonts were a bit tricky. Especially
in Russian. I just needed to save the program text file itself in UTF8 with BOM
encoding. I spent a long time trying to figure out why it wasn't working. That
was my last resort. Could the encoding of the source file really have an
effect? I spent a lot of time debugging, so to speak. I started from what I
saw on the screen, line by line, looking for the problem.
Now I need
to organize all this into BI - BAS blocks. So that all the functions I work
with are there. For example, FTText. That's where I work with text. Library
functions and what I've wrapped in my functions. And a few other little things.
Like where to put the library files. The compiler doesn't always see them. And
then I can start making my own games. With these technologies I've already
mastered.
I spent a
lot of time setting up all these libraries. But in the end, everything worked.
Now I have sprite images in PNG format, 32-bit color. With a background cutoff.
And I can scale them pixel by pixel. It's the perfect solution! I'm even
pleased with myself. I can play an MP3 file as a theme song. And I can also
create sounds for all events in the game itself. Gunshot sounds and explosions,
for example. And the theme song plays. The volume can be adjusted.
And also,
separately, these are fonts. TrueType format. They're great fonts. They have
different languages. English, that's clear. Russian is there. And I can display
all of this. In different sizes. Different colors. Set a background for the
text. There were some problems with that, but I managed it. And all of this
will now help me in creating the game!
Although I
still have a few questions. About the library, how to connect it, some tweaks.
But you can leave it as is if you need to. Where do I find the files for
the library?
Dima Link is making retro videogames, apps, a little of music, write stories, and some retro more.
WEBSITE: http://www.dimalink.tv-games.ru/home_eng.html
ITCHIO: https://dimalink.itch.io/
TUMBLR: https://dimalink.tumblr.com/
BLOGGER: https://dimalinkeng.blogspot.com/
MASTODON: https://mastodon.social/@DimaLink




Comments
Post a Comment