Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / 2d tile system?

Author
Message
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 26th Sep 2007 01:30
hi,how would you make a 2d tile system for a 2d game???

like a platform type game where the player bumps into certain tiles,swims in others etc. ??
Insert Name Here
17
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 26th Sep 2007 19:00
...with practise.

Our home is our world, our life, home is our world...
Homeworld: The ladder
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 26th Sep 2007 21:26
Make a UDT for a tile, containing data for what tile type it is, and any other data you may want, then, make a 2D array. Fill it in with data, then display it by looping though each dimention, getting the data, and pasting a specific image at that tile's position.

Then, when making controls, check what tile type the player is on so you can ensure you can move him.

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Mr Kohlenstoff
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 4th Oct 2007 13:11
I would use Tile-Templates, and each tile gets a pointer to one template. This technique doesn't need that much memory. And if you make an editor you don't have to change hundreds of tile's attributes but just the template (e.g. if you want to use another texture).
This template should have, like zotoaster said, a user defined type, defining things like "walkable", "Sprite_ID" and maybe even "SpeedFactor" etc.

David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 4th Oct 2007 22:55
ok.. but how would i even get started??

i dont know what types are? or how to make one.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Oct 2007 23:10
I wrote a tut. Search.

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers

Login to post a reply

Server time is: 2024-09-27 05:12:47
Your offset time is: 2024-09-27 05:12:47