Jump to content
xisto Community
Sign in to follow this  
Daehawk

2d Traveling On Browser PHP Game

Recommended Posts

Alright I am developing a PHP Game. I have worked on one but left them due to creative differences. Something that I have had trouble finding in script tutorials and script archieves is a way to do like a 2d mini world inside of the game. Like let's say that you have a icon for your person, it would put it on the map where you are at in the game and it moves as you go to different places in the world. something like this(horrible cause done with X's and | _):_______________________|_|_|_|_|_|_|_|_|_|_|_|_|_||_|_|_|_|_|_|_|_|_|_|_|_|_||X|_|_|_|_|_|_|_|_|_|_|_|_||_|_|_|_|_|_|_|_|_|_|_|_|_|Then they move to a new square lets say...to the right._______________________|_|_|_|_|_|_|_|_|_|_|_|_|_||_|_|_|_|_|_|_|_|_|_|_|_|_||_|X|_|_|_|_|_|_|_|_|_|_|_||_|_|_|_|_|_|_|_|_|_|_|_|_|But instead of that it would have some actual graphics and the X would be your icon character. If anyone can think of how I could do this or a tip on where to look or things to try would be greatly appreciated.

Share this post


Link to post
Share on other sites

Two dimentional array. $array_matrix[3][2]="Whatever data you want to store regarding the postion of 3rd row and 2nd column";

Share this post


Link to post
Share on other sites

Two dimentional array.

 

$array_matrix[3][2]="Whatever data you want to store regarding the postion of 3rd row and 2nd column";

149458[/snapback]


Alright thanks for the help OpaQue.

Share this post


Link to post
Share on other sites
:P I am doing the same thing in my game (kinda), did you break into my home and steal my plans? :P <jk>

Anyway, the way I plan on doing what you have mentioned above involves the use of the GD (Graphics Device) Module for PHP.

Using the GD module, you can draw the background map, and then place your character image right on top wherever you want, and then send that new combined image to the browser.

Next, you would want to output the image into an <input type=image> tag, that way when a player clicks on the image it gets posted back to the page with the X, Y coordinates of where the player clicked. You can then move the player to that spot, or perform some other action!

I hope you were able to follow that, here is a good site to learn about <input type=image> if you need to: Image Input Types


Also, I have an example of my map online, but so far it only generates alternating town icons, and isn't posting X & Y coordinates back to my page yet..
Check it out here: Magick World Map
(Please note, this is the very first public viewing of my map, and not all towns have been named, but please do not take my ideas! Thx!)

Anyway, I hope that helps in some way!

Share this post


Link to post
Share on other sites

Wow I love that map. What did you use to make it? Nah I'm not going to steal your design...I have started working on a few things on my game...it's not totally set up...since it's alot of work to make a game. But slowly and steadily I am creating it. Eventually when I have a finished model of my game I will probably post it...one of my mine problem is with the databases...I think some of my coding doesn't like Internet Explorer...cause when my alpha testers get on Firefox and do it..everything works fine....so yeah....something is wrong with it....gotta work on that and figure it out now...I have set up some worlds but my graphics aren't really that excellent...it's more of the 2d graphics from MMO's that I've worked on...gonna work on graphics after I finish setting up all the rest of the game.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.