Basic Tile question
I''m trying to make my first tile based background image engine.(so there''s a scrollable background, which is tiles.) And I have a basic question, do create the background on it''s own surface? (somebody should make a basic tilebased engine tutorial for newbies)
Here''s how you would go about it creating a square/rectangle tile engine.
First set up a Primary surface (DDraw) with and attached backsurface. Second, load your tiles into an offscreen surface. Now the only thing left to do is blit from the offscreen surface to the backsurface and then do your flip.
The tiles should be a preset size say 32x32 or something divisable by 2 (without a remainder). The image that you load into the offscreen surface should have these tiles placed in a row/column fashion, this allows you to "pick" the tiles off this surface when you do the blit.
This should get you started... It''s easier than you think.
Dak
First set up a Primary surface (DDraw) with and attached backsurface. Second, load your tiles into an offscreen surface. Now the only thing left to do is blit from the offscreen surface to the backsurface and then do your flip.
The tiles should be a preset size say 32x32 or something divisable by 2 (without a remainder). The image that you load into the offscreen surface should have these tiles placed in a row/column fashion, this allows you to "pick" the tiles off this surface when you do the blit.
This should get you started... It''s easier than you think.
Dak
Dave Dak Lozar Loeser
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."--anonymous
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."--anonymous
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement