gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Questions I have.

#13958 - vb_recruit - Thu Dec 25, 2003 10:01 pm

Hello all. I recently download "HamLib" and have been using it, and it seems good for GBA development. I have got sprites/maps happening, but I do have a few questions.

1) Is it sensible, and is it a common practice to use bitmap/pcx images as maps? (as a pose to making a map editor that makes .map files, say).

2) How do you guys go about collisions? I used Visual Ham's map editor to make my level, made it a bitmap, got it loading, with a sprite, but collisions? like, certain tiles on the map. How do you guys go about doing this? Do you make your own editors which load your maps and you can put collision tiles down, or what?

Thanks,

-Chris
_________________
[img]
http://gwsigs.freehomepage.com/images/chris.jpg[/img]

#13960 - Xax - Thu Dec 25, 2003 10:27 pm

vb_recruit wrote:
1) Is it sensible, and is it a common practice to use bitmap/pcx images as maps? (as a pose to making a map editor that makes .map files, say).

Warning: I'm a novice, but from what I've gathered, it depends on what kind of game you're making. Typically this would be a bad idea, because it would eat up so much memory. There is a 1024 8x8 tile limit per map (taking up 64k if you're using 8-bit tiles; 32k for 4-bit tiles), so using a seperate tile for each 8x8 space on the screen amounts to 600 tiles. That's a lot of tiles to blow for one screen, assuming you've got a scrolling game in mind. For scrolling games, using tilesets and tile maps would be a much more economical use of memory, because you have the ability re-use any of the tiles in your tileset, conserving tile space.

vb_recruit wrote:
2) How do you guys go about collisions? I used Visual Ham's map editor to make my level, made it a bitmap, got it loading, with a sprite, but collisions? like, certain tiles on the map. How do you guys go about doing this? Do you make your own editors which load your maps and you can put collision tiles down, or what?

Do you mean, how do you set certain tiles so that sprites can't move over them (such as walls)? I'm thinking you could either have the program recognize certain tiles as unpenetrable, or you could have an array for each map which indicates which tiles are unpenetrable. Anyone else have any ideas?

#14043 - yaustar - Sun Dec 28, 2003 2:48 am

you can use a collision layer which uses a little more memory but easier to control. Look at the the Up to You tutorials.
_________________
[Blog] [Portfolio]