954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

2D Maps & Bounds

Hello, i started learn litle "Game-Developing", i download Tiled QT to create game map, but my question is, (Game will be in java)
How i make my character go to specifically positions, i mean, in map are some walls and playrs must not go above the image...

An idea is to daw a rectangle and create X/Y cordinates and decleare wich one playrs cant, so when player arrive to x/y it cant go more that way..

PS: Any good free tool to create MAPs? TiledQ seems good... idk...
soz for my english

Panathinaikos22
Junior Poster
135 posts since Aug 2011
Reputation Points: -4
Solved Threads: 6
 

you could create a "map" which is composed by several tiles (32x32 pixel images or whatever) and each tile could have a boolean variable that determines whether or not that particular tile is solid (if solid, nobody can walk on it, for example).

either that, or have an array called impasasble_tiles or something which contain int values (for example, tile_1 is grass, tile_2 is wall), so if the particular tile the player wants to go to is in the impassable_tiles array, then that means he cant go.

there are many ways to go about doing this.

thanatos1
Light Poster
34 posts since Jul 2009
Reputation Points: 7
Solved Threads: 3
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You