avatar.alex Posted August 20, 2008 Share Posted August 20, 2008 Ive searched and I couldn't find anything like this ok...well one of my game developers have created a type of explore system...but its written in javascript and PHP so its hard for me to tweak it...but I need something that moves around like this http://www.bbgamezone.com/map/ but if I have a house or something be able to enter it...some how? IDK...but everythings good just entering the houses, shops, shrines w/e it may be i would like to know how to do this? Heres the topic http://community.bbgamezone.com/index.php/topic,1000.0.html for more detail...but if anyone already knows a source out there that is similar to this feel free to share with me!! thanks Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 20, 2008 Share Posted August 20, 2008 I have written this however I can't just give it to you. You need to store the map in a table with x/y coordinates and then a terrain type dirt, grass, tree, town entrance etc. You need another table with the relationships for the terrans. The compass on the top of the page simply is a form that gives the system new coordinates to move the sprite to. So to move all you need to do is query for that sprites current location, query for the square they are moving to location and type Verify its 1 square away and isn't an inmoveable or special if special then teleport the user (such as into a town or dungeon) Update the sprite's X/Y in the database Then generate the map Quote Link to comment Share on other sites More sharing options...
avatar.alex Posted August 20, 2008 Author Share Posted August 20, 2008 OK so in the code where would I look to see what to change? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 20, 2008 Share Posted August 20, 2008 the form inputs that version uses ajax the version I have uses a page refresh (more ad impressions) so u need to design the ajax to develop the map area and then update the main page area via the html response. Its not a very simple thing Quote Link to comment Share on other sites More sharing options...
avatar.alex Posted August 20, 2008 Author Share Posted August 20, 2008 i know its not simple but couldn't I just do something like make a table and put x,y cordites in the table along wit map number and so if they land on 3,4 I can make it so its like header("location:map.php?id=".$mapnum.); and it sends them to map 2 or something Pluse i dont have ads in my game...? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 20, 2008 Share Posted August 20, 2008 look into basic ajax and try and make a simple form with a button so when you hit it it updates the content area on the page (there are tutorials on this) then add in 3 more buttons for up/down/left/right and then go back into your ajax action page and beef it up to sync up to your map database. Quote Link to comment Share on other sites More sharing options...
avatar.alex Posted August 20, 2008 Author Share Posted August 20, 2008 k thanks!!! ill look into all that ill show you guys when im done!! Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted August 20, 2008 Share Posted August 20, 2008 you can also download a copy of the open source game made in PHP. Dragon Knight. http://dragon.se7enet.com/dev.php That has a movement system. And a map. however doesn't use the live terrain and sprite stuff that you want. But you will see how things are coded within PHP to make the player move and interact. Quote Link to comment Share on other sites More sharing options...
avatar.alex Posted August 20, 2008 Author Share Posted August 20, 2008 you can also download a copy of the open source game made in PHP. Dragon Knight. http://dragon.se7enet.com/dev.php That has a movement system. And a map. however doesn't use the live terrain and sprite stuff that you want. But you will see how things are coded within PHP to make the player move and interact. do you think that you could help me pull that map system from the game cus you have more EXP with the script? Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted August 20, 2008 Share Posted August 20, 2008 the movement part of the game is in explore.php. It makes a function called move(); , to move the character 1 space north, south, east or west. You can easily change the custom functions used in Dragon Knight to normal PHP functions. Such as doquery(). You can change that too mysql_query(); with some minor adjustments in the queries. <?php // explore.php :: Handles all map exploring, chances to fight, etc. function move() { global $userrow, $controlrow; if ($userrow["currentaction"] == "Fighting") { header("Location: index.php?do=fight"); die(); } $latitude = $userrow["latitude"]; $longitude = $userrow["longitude"]; if (isset($_POST["north"])) { $latitude++; if ($latitude > $controlrow["gamesize"]) { $latitude = $controlrow["gamesize"]; } } if (isset($_POST["south"])) { $latitude--; if ($latitude < ($controlrow["gamesize"]*-1)) { $latitude = ($controlrow["gamesize"]*-1); } } if (isset($_POST["east"])) { $longitude++; if ($longitude > $controlrow["gamesize"]) { $longitude = $controlrow["gamesize"]; } } if (isset($_POST["west"])) { $longitude--; if ($longitude < ($controlrow["gamesize"]*-1)) { $longitude = ($controlrow["gamesize"]*-1); } } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.