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 / How to use Texture Maps and Data Maps to Create A Top-down 2D Game

Author
Message
Romedi
19
Years of Service
User Offline
Joined: 14th Jun 2005
Location: East Alabama
Posted: 17th Jun 2005 03:33
I understand the basic idea of making a map out of numbers:

1-1-1-1-1
1-2-2-2-1
1-2-2-2-2
1-2-2-2-1
1-1-1-1-1

1's cannot be passed through because they have collision turned on (not sure how) and 2's your sprite can walk on.

I know that somehow I have to code this so that the game only checks squares adjacent to the sprite, or the square the sprite is in, but I am not sure which of these to check for.

My second question comes from a few incomplete tutorials I have found. How do you program a map editor to make maps using tiles I have made. I looked for hours for a Classic Zelda tutorial and I could not find one for DarkBASIC Classic or Pro that was complete. I use Classic, but figuered that even a Pro tutorial could be very helpful. I need to know how to make the computer translate the numbers (and how exactly you program these number maps) into the corresponding map tiles.

If anyone can help on how to:

Make my own editor that will save the tiles/maps into DarkBASIC Classic format.

Position the camera over a "square" of the map

and how to scroll from one square to another.

I would really be most appreciative.



THanks
Mr Pointless
19
Years of Service
User Offline
Joined: 17th Oct 2004
Location: Stuck in the UK
Posted: 18th Jun 2005 05:31
Hmmm.

The simplest way would be use "sprite collision([Your character sprite],0)" to get the number of any sprite touching you character. and work from there.

A more accurate method could be to get the x and y co-ords of you character, divide it by either the number or size of the tiles (I can't remember as I been away from DBPro for a couple of months thanks to my back ) and round the answer up (if the decimal is > .5) or down (if not)

Hope this helps.

Oh s***, there goes the planet.

Login to post a reply

Server time is: 2024-09-23 21:29:04
Your offset time is: 2024-09-23 21:29:04