Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Paul9

Loading Tiles

This topic is 6480 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I load tiles onto the screen, should I load each individual tile by it''self and then put it in the right place or should I have the whole area in a bitmap and load it striaght onto the screen? -Paul9

Share this post


Link to post
Share on other sites
Advertisement
To answer your question you must first determine whether or not there is any functionality to your map. Is it posssible for tiles to change or are any animated? If so then you should probably blit one at a time with the right RECT structure. The speed will still be very fast. If you use a huge bitmap with the map this can sometimes create problems. But many games still use that technique so decide on the maps functionality.

Share this post


Link to post
Share on other sites
The way I do mine is put my tiles into a template then each tile class has 2 RECT''s one for the source of the graphic and another for the desitnation of the graphic. The source graphic rect knows where the graphic is in the template acording the the tiles state I just use a switch statement.

switch(tilestate)
{
case WALKEDON:
{
switch(tiletype)
{
case GRASS:
{
sgraphic.right=grassframe%TILES_IN_TEMP_WIDTH*TILEWIDTH+TILEWIDTH;
sgraphic.left=grassframe/TILES_IN_TEMP_WIDTH*TILEWIDTH;
etc....


hope that helps

Share this post


Link to post
Share on other sites
Thanks for the help, guys. Now I''m going to use a system of drawing the screen row by row and setting flags in arrays, so I can do something like:
''Can I walk on tile # 15?
if tiles(15).walkable=true then
''Blah blah
endif

Yes, I am doing this in VB because it''s my first attempt at game programming. My next project will probably be done in C++.

-Paul9

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by OoMMMoO

The way I do mine is put my tiles into a template then each tile class has 2 RECT''s one for the source of the graphic and another for the desitnation of the graphic. The source graphic rect knows where the graphic is in the template acording the the tiles state I just use a switch statement.

switch(tilestate)
{
case WALKEDON:
{
switch(tiletype)
{
case GRASS:
{
sgraphic.right=grassframe%TILES_IN_TEMP_WIDTH*TILEWIDTH+TILEWIDTH;
sgraphic.left=grassframe/TILES_IN_TEMP_WIDTH*TILEWIDTH;
etc....


hope that helps



Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!