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 / Tiles help

Author
Message
GameMaker Jason
21
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 29th Feb 2004 13:27
I'm will soon be makin' pacman with my team "the code monkeys" and i was wondering how to use data statements or a text file for a map

11111111111111111
10000000200000001
10000000000000001
11111111111111111

I want somethin like this that has 1 for the wall 0 for the ground and 2 for enemys. how would i read this map and display the correct tiles?

BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 1st Mar 2004 07:51 Edited at: 1st Mar 2004 07:54
You already have a perfect data structure right there, you just need two more statements at the top:

x y

So you can know how many tiles across, and how many down your map is. Put DATA in front of each line and include it as a .dba. Since you know how many are across and down you can create an array based upon the dimensions. In the case of the example above your array would be something like DIM TileData(17,4).

Then create a for...next loop that reads each bit of data in each row and puts them in the appropriate spots in the array. Then it is a simple matter of placing the tile types on the screen depending on how you split the screen up into tiles, what images are associated with what tile types and whatnot.

BTW, love the name... Code Monkeys... I would buy games from you just because that was your name.

Crazy Donut Productions
Current Project: KillZone
GameMaker Jason
21
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 2nd Mar 2004 21:20
how do put my data statements into a 2D array and then create a box if there is a 1 in the array then place the box in a certian place?

Login to post a reply

Server time is: 2024-11-26 07:39:10
Your offset time is: 2024-11-26 07:39:10