• 9
• 9
• 10
• 9
• 10
• entries
108
319
• views
137856

BooGame and Tile Studio

394 views

After hacking at it for about three hours, I finally got Tile Studio working quite nicely with BooGame. I used its code output feature to output script files which are then interpreted by BooGame during runtime. Here's a shot of BooGame's new ScrollDemo example:

If you download the latest build, you'll see that you use the arrow keys to move the screen around. The moving background gives a neat effect. Unfortunately I'm extremely puzzled with the animated water tiles at the bottom right of the map, I'll take a look at those later. Big thanks go to Scet on this one.

Although it might be only on my system, OpenGL misses a few pixels with the tiles. I'm not entirely sure how to fix that, but I'm sure I'll find something.

SourceForge seems like the best place to host BooGame, so I submitted a project submission form. I would host it on my own site, but SourceForge gives you a load of project management resources which are very nice for open source solutions. I should have everything moved over by next week. Until then, enjoy!

Random Interest

The Iceberg

What problem(s) are you having with the animated tiles?

I just don't understand how Tile Studio sets up the sequence data. Right now I think I have the sequences outputed to an animation, but I'm really not quite sure how it works to say how it displays in the tile data.

Each sequence is just two arrays of the same length, the length being the number of frames. One is for the tile indices and the other for the frame rates. The tile indices work the same wall as the ones used for the map data, 0 is nothing and the others reference a tile in the sprite sheet. The "frame rate" array represetns how many frames each frame of the animation should be on screen, however frame based timing sucks so you might want to think up another method.

Here's some pseudo code(might explain things a little better)

int Length = 10; // animation is 10 frames long
int Indices[10];
int Rate[10];

int Count = 0;
int CurrentFrame = 0;

Render() // called once per frame
{
if( Indices[CurrentFrame] != 0 )
{
DrawTile( Indices[CurrentFrame] - 1 );
}
Count++;
if( Count >= Rate[CurrentFrame] )
{
Count = 0;
CurrentFrame++;
if( CurrentFrame >= Length )
{
CurrentFrame = 0;
}
}
return;
}


Oh yeah, for sequences in maps like the water there. If you come across a tile number that's negative that means it a sequence. The sequence to draw is the positive version of that number. So something like this:

DrawSequence( Abs( MapData[y][x] ) - 1 );

Be sure that you're reading them into whatever array you have in the right order. The numbers Tile Studio uses reference the order it was output. So a map tile with the value of -1 represents the first sequence in the file.

Quote:
 Abs( MapData[y][x] ) - 1
AHAH!! That's what I was missing!!! Thanks a lot!