Jump to content

Tile base maps?


alexdee67

Recommended Posts

Ok i don't know if this is the right cat to post this in but here it goes.

 

Im trying to create a 2d tile base mapping system. I dont know where to start. I was looking at XML to do so. But i don't know how to manifest it on the page. Another thing I came across was XNA. I don't understand how to do this. I also was concidering AJAX or Javascript?

 

Link to comment
https://forums.phpfreaks.com/topic/207296-tile-base-maps/
Share on other sites

It depends how you want to achieve it. I remember I made a simple tile based map game where you could click on tiles to move your character to. It was built with PHP, with a few x and y variables as well as a few others. You just need to use math to determine the tiles to show and so forth. I also attemped to implement an A* Path Finding Algorithm that I tried to code.

 

The best place to start, would be to create the map. Then, you could either slice it into little pieces, or do it dynamically with PHP. After that, splitting the map into tiles shouldn't be too hard, just determine the size of your tiles, how many tiles will be displayed both on the X axis and Y axis.

 

Generally, you'd do it by showing your character in the center, unless they are near the edge of the map, and then determine how many tiles will be to either side of them. Then when they change their position, you'd re-calculate the X and Y values.

 

Just apply some math.

 

Good luck.

Link to comment
https://forums.phpfreaks.com/topic/207296-tile-base-maps/#findComment-1083901
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.