d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Using Tile Sheet For A Game
Add Reply New Topic New Poll
Member
Posts: 2,769
Joined: Dec 24 2009
Gold: 14.00
Aug 15 2014 06:21pm
Here's a page with a bunch of 32x32 tiles.

http://opengameart.org/sites/default/files/hyptosis_tile-art-batch-1.png

My question is how do people create backgrounds? Is it better to assign a value to each tile and create the terrain via code, or doing it by hand in paint, photoshop, etc.?
Member
Posts: 88
Joined: Jun 22 2014
Gold: 0.00
Aug 15 2014 06:32pm
I would think it better to create the terrain via code, and partition areas into 2D arrays of some maximum dimension. It's obviously not as simple as that, but if the game is linear I can see a straightforward way of using these and traversing the terrain with an animated sprite.
Member
Posts: 2,769
Joined: Dec 24 2009
Gold: 14.00
Aug 15 2014 06:59pm
So what's the best way to store the tiles? Crop every single one and put it into a 2d array? E.g: if one of the tile sheets has 30 tiles across and 30 down, I should make an array[30][30]?

How do I design maps later? Keeping track of tiles seems tough when there are 1000+

This post was edited by Foxic on Aug 15 2014 07:18pm
Member
Posts: 88
Joined: Jun 22 2014
Gold: 0.00
Aug 15 2014 07:58pm
Quote (Foxic @ Aug 15 2014 05:59pm)
So what's the best way to store the tiles?  Crop every single one and put it into a 2d array?  E.g: if one of the tile sheets has 30 tiles across and 30 down, I should make an array[30][30]?

How do I design maps later? Keeping track of tiles seems tough when there are 1000+


If you have that much art, I don't see another way of doing it.

It probably seems obvious, but store art that will be referenced sequentially close to one another in the same array. There may be other data structures, without a lot more detail it's difficult to say.

Storage in an array makes sense if you're going to draw environments that make use of nested loops and need to fill out square areas. If not (and it's more or less linear), there's no reason to use this data structure. It all depends on context!
Member
Posts: 2,769
Joined: Dec 24 2009
Gold: 14.00
Aug 17 2014 03:22pm
Wouldnt it be better to create an editor? Or use an already existing one but I assume its worth learning how to make one

Need more opinions
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll