Tile-Based Game Map

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Teonnyn
Forum Commoner
Posts: 58
Joined: Tue Dec 23, 2008 4:07 am

Tile-Based Game Map

Post by Teonnyn »

Hey to all!
I'm trying to make a tile-based game map in much the same fashion as the old Space Merchants game and others where you moved your ship around from sector to sector.
However, my research has proven to be fairly futile at this point. I came up with one method, but it's not the best and I've had no luck getting movement working beyond
displaying the player sprite. This is not an isometric tile map - just a standard 500px * 500px with tiles 50-50px in size. This is an addition to an already existing website, so
I don't really need things like login/logout/etc.

Could anyone offer some advice or examples/samples of code - or maybe point to a tutorial? I keep coming up with Actionscript examples, not PHP.
jraede
Forum Contributor
Posts: 254
Joined: Tue Feb 16, 2010 5:39 pm

Re: Tile-Based Game Map

Post by jraede »

If it's real-time or even turn-based you shouldn't rely on just PHP, because you'd have to refresh the page every time something happens. Your best bet is probably to use AJAX (Javascript with PHP) in order to update game information and also move the pieces around without refreshing the page.
Teonnyn
Forum Commoner
Posts: 58
Joined: Tue Dec 23, 2008 4:07 am

Re: Tile-Based Game Map

Post by Teonnyn »

That's the plan, pretty much. It's not wholly real-time but I was planning on doing the movement with AJAX/jQuery. I'm not sure if the map should be done in pure Javascript or displayed with PHP. As said, I got a primitive version of PHP display working but it's very tough to grab the right information from for JS - what type of tile, player position, etc.
Post Reply