Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Poetronic

Hi MrTAToad, I know about the licensing issue, but since I'm not planning to sell my game (who's gonna buy the millionst breakout clone anyway), that's not a problem. I also figured it might be better to switch songs relative to the current level. Then the gameplay itself is not interrupted when loading the file. Perhaps not the most elegant solution, but as I want to complete the game soon (at least the first 32 levels), I decided to go with the most pragmatic approach.  :P

Still, if anyone out there knows about a simple solution for preloading mod-files - feel free to leave a reply :)
Ok i just found out that Schranz0r posted a BASS.dll somewhere... maybe I'll drop him a PM.
So is there another way of preloading music/mod files besides FMOD? BASS maybe?
Hm ok, now that really confuses me.  :blink:

So what exactly do I need in order to preload mod-files?
Which version of FMOD from their download page? (
Which are the functions that can be used in GLBasic?
Is there a tutorial somewhere so I don't have to bother the people in this forum?

Sorry, but the link to your post didn't make things clearer to me at all - if anything, things seem to have gotten much more complicated...  ::)

Hm, Stream_Open / Stream_Play, are those OpenGL-commands? Didn't find them in the GLBasic documentation.

Anyway, I still believe that it has to be possible to use FMod_Load() and FMod_Play() to preload sounds at the start of the program and play them from memory. Would be kind of odd if that wasn't possible...

So if anyone has any idea of how to preload MOD-files and play them from memory, please leave a reply :-)
Hi Quentin,

I would love to preload all music files, but I am not sure how that works with Fmod_Load(). Is it possible to read some audio-files into an array and then selectively play them using Fmod_Play()? I think that Fmod_Play() only plays the file that is currently loaded, so whenever I need to play a different file, I have to use fmod_load(myfile$) first... Fmod_Play(myfile$) doesn't work, right?

Or is it possible to do something like this (last time I tried it didn't work):

Code (glbasic) Select

Global m[]
Dim m[3]

m[0] = Fmod_Load("file1.mod")
m[1] = Fmod_Load("file2.mod")
m[2] = Fmod_Load("file3.mod")


Hope you can help me out here. Thanks in advance :-) ! P.
Hi all,

when I load a MOD-soundfile with Fmod_Load() while playing the game, the graphics lag for a few millisecs while the file is getting loaded. The code I use is pretty straightforward and supposed to switch between two files only.

Code (glbasic) Select
IF FMod_IsFinished() = TRUE
IF snd_current% = 0
snd_current% = 1
ELSEIF snd_current% = 1
snd_current% = 0

Now my question is: Is there a better way to load/play songs via Fmod, and how can I prevent the short lag while loading?

P.  :)
I'd say please post your code :-)
Hello, brief question - at some points in my game I am positioning text elements at the center of the screen according to the length of the string. Something like PRINT string$, screenwidth/2-LEN(string$, TRUE)/2, screenheight/2. The Problem is: it seems as if the string is printed before the relative position is determined, which sometimes leads to a very brief "flickering" of the text into position. Is this supposed to happen, or am I doing something wrong?
Hey BdR,

checksum protection is just what I decided to do even before you posted your comment :-) It already works (thanks to the easy usage in GLBasic), so no need to change anything there anymore. I would still like to be able to include ALL my game data in a single executable file. I simply don't like to have people download a rather small game and then it turns out it consists of 3 Folders, 2 DLLs, 82 images, 10 song modules - you get the point...

Thanks for your comment, I hope I will find some time soon to complete version 1.0a of my game :) Will also have a closer look at Wizorb later on.

This works, just try to replace the values with your own:

Code (glbasic) Select

SETSCREEN 640,480,0



UNTIL KEY(01) = 1 // ESC



     DRAWRECT 100, Move, 10, 10, RGB(255,255,255) // Replace with your image
     INC Move, 1 // This is the shorter version of Move = Move + 1; when using long veriable names this is much more handy

     IF Move > 480 THEN Move = 0


And tile maps are not such a great amount of work. Try using the DATA structure pointing to the specific tiles. Sounds complicated, but in fact it is rather simple. I don't have much time right now, but if you want to, I could try to explain it to you tomorrow or the day after :)

Hi Hotshot,

GLBasic definitely supports png-files and transparency. I am making heavy use of them in my current project.

Concerning your questions:

Code (glbasic) Select

should be

Code (glbasic) Select

% means INTEGER, # means FLOAT, $ means STRING.

INTEGER can be used to convert floats into integers. You do it like this:

Code (glbasic) Select

As for the background image, try doing it like this:

Code (glbasic) Select
LOADSPRITE "yourimage.jpg", 0 // 0 instead of variable "yourimage"

This loads your image with ID 0. Use 1,2,3,4 etc. for more images. Then draw the sprite like this:

Code (glbasic) Select
DRAWSPRITE 0, x%, y% // Draws the sprite with the ID 0 at the coordinates x, y

You can also stretch, rotate, and/or zoom your sprite:

Code (glbasic) Select
STRETCHSPRITE num%, x%, y%, width%, height%
ROTOSPRITE num%, x%, y%, phi#
ROTOZOOMSPRITE num%, x%, y%, phi#, rel#
ZOOMSPRITE num%, x%, y%, relx#, rely#

I would also recommend two things for your project.

1. Try using a tile map with small images instead of one large image for the level background graphics.
2. Try coding your game so that it runs with the same speed on different computers (search for "deltatime" in this forum).

Hi Hotshot,

try placing the function after the function call:

Code (glbasic) Select

SETSCREEN 640,480,1






// This is your function
         DRAWSPRITE BACKGROUND, 100, 100

Just tried to play kenta's "Blocks"...

...but about ten seconds into the game my eyes felt like sand paper and then almost exploded. Seriously, graphics and gameplay are outright horrible in my opinion.
Hi BdR,

.SBX files may be an option, but they also don't really protect your media files. I am still hoping for an INCBIN-command to include binary files in your executables sooner or later (although I am not quite sure whether that's really a solid protection (but I assume it is way better than shoeboxing files).

For the moment I will be satisfied to release a working version for Win/Linux/MacOS soon (without a public level editor in V1.0, but with an online hiscore database for the standard levels which is already in place and working). I will definitely take a look at kenta's "Blocks"!

Thank you for the hint at SAVEBMP!  :)