2d Traveling On Browser - PHP Game

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

2d Traveling On Browser - PHP Game

Daehawk
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.

 

 

 


Reply

OpaQue
Two dimentional array.

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

Reply

Daehawk
QUOTE(OpaQue @ Jun 9 2005, 01:53 PM)
Two dimentional array.

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




Alright thanks for the help OpaQue.

Reply

SystemWisdom
ohmy.gif I am doing the same thing in my game (kinda), did you break into my home and steal my plans? tongue.gif <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!

 

 

 


Reply

Daehawk
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.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics

Keywords : 2d, traveling, browser, php, game

  1. Php Source Code Unveiled In Browser?
    is that possible? (7)
  2. Need Some Help In File Browser
    listing all sub folders and files in them. (8)
    Hey I want to create a very simple file browser, so that, it reads all the sub-folders which are
    places in a directory, and the files inside the sub-folders (It reads only files inside sub-folders
    and list them in simply. ) Also, it creates a directory (any name) inside each sub folder. My
    Following code reads on the files inside the main directory, it does not read the files inside the
    sub-folders.. I appreciate any help. CODE <? $path = "./"; $dir_handle =
    @opendir($path) or die("Unable to open $path"); whil....
  3. When The Browser Is Closed
    (4)
    Hi, I am storing data in a table based on the session id. When the user closes their browser, I
    want to run a quick delete so that the entery to the db with that session id is removed. How can I
    do this? Thanks....
  4. Browser Problems, Maybe?
    Firefox vs IE (6)
    Alright, I coded something the other day for the game I am working on making, and a few of my
    friends I allowed to get on it and test things out. Well....the ones that were on IE their
    characters were made but the User variable as in which account they were on just stayed blank, while
    with my friends that were on Firefox, everything worked fine and they could play perfectly... So I
    was wondering, with PHP sql codes being sent to the database, is there something special you have to
    do to make it work on both, or could it be a setting on the IE that was messing with it......

    1. Looking for 2d, traveling, browser, php, game

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for 2d, traveling, browser, php, game

*MORE FROM TRAP17.COM*
advertisement



2d Traveling On Browser - PHP Game



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE