Advertisement

Basic Tile question

Started by March 21, 2000 05:54 PM
2 comments, last by Chrono999 24 years, 7 months ago
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
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
Advertisement
So I have a "pallet" surface will all the different tiles on it, and then blit whatever tile I want onto the backbuffer?
Yes, that''s pretty much it.
Working on: DoP

This topic is closed to new replies.

Advertisement