codenature Posted June 8, 2012 Share Posted June 8, 2012 Hi, I am making a game and I want the player to use a coordinate system using North, South, East, and West form buttons to navigate the virtual X Y coordinates. The only problem is, if I want to put a monster at location x=100 y=100 The player would have to move to that particular tiny dot on the grid, so the likelihood of them coming in contact with the monster is almost nonexistent. Please, if anyone could please show me a proper way to put into a monster in the database using a coordinate system and then the php check in the form please for the monster coordinates for one example. I can repeat the rest. It seems like I would need to check for a range of points from a virtual square, but that is a lot of numbers!! Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/263857-xy-coordinate-system-for-game-areas-question/ Share on other sites More sharing options...
KevinM1 Posted June 8, 2012 Share Posted June 8, 2012 I'm not quite sure what your problem is. Do you only have one monster on the map? I mean, most games tend to either have monsters placed in locations that the player would have to go through (certain hallways/rooms/in front of doors), so they're guaranteed to encounter them, or have them randomly generated where each move by the player rolls the dice behind the scenes to see if they've stumbled into a fight. Quote Link to comment https://forums.phpfreaks.com/topic/263857-xy-coordinate-system-for-game-areas-question/#findComment-1352139 Share on other sites More sharing options...
codenature Posted June 8, 2012 Author Share Posted June 8, 2012 i realize what you are saying. I am making a field, where I want to player to be able to roam, and when they roam to a certain x y coordinate that I put in the database where a monster exists, they have a monster encounter. so if monster is x100,y100 player hits on that coordinate fight begins, problem is there is a very small chance in the whole map of it hitting that spot. the submit direction form checks for known monster points, and monsters show up as the points are landed on Any better suggestion would be great though. please Quote Link to comment https://forums.phpfreaks.com/topic/263857-xy-coordinate-system-for-game-areas-question/#findComment-1352142 Share on other sites More sharing options...
codenature Posted June 8, 2012 Author Share Posted June 8, 2012 OOPS I guess I didn't realize what you said. The random encounter is GREAT. But I still can't use that for encountering places like towns, caves, castles, etc for a story plot. Quote Link to comment https://forums.phpfreaks.com/topic/263857-xy-coordinate-system-for-game-areas-question/#findComment-1352146 Share on other sites More sharing options...
KevinM1 Posted June 8, 2012 Share Posted June 8, 2012 OOPS I guess I didn't realize what you said. The random encounter is GREAT. But I still can't use that for encountering places like towns, caves, castles, etc for a story plot. The biggest thing is figuring out how to both constrain and direct the player. You need to make parts of your grid inaccessible (like mountains), and you also need to tell the player where to go. That's how the classic, 2D RPGs worked. With games that rely on a map grid, you're never going to be able to guarantee that a player will hit a certain point on the map unless you force them there. If exploration/freedom of movement is what you're aiming for, the best you can do is limit where they can go and make the next step of the journey obvious. Quote Link to comment https://forums.phpfreaks.com/topic/263857-xy-coordinate-system-for-game-areas-question/#findComment-1352157 Share on other sites More sharing options...
codenature Posted June 8, 2012 Author Share Posted June 8, 2012 Thank you very much for that insight. I will use random monster die roll generation for the monsters, and then I will direct them to the places like cave, castle, or town. I think I will do this by making "mountain walls" like you said, made up of long lines that say when you hit one let's say the north mountain points in between x-500 and y500, so that will be my long mountain wall, then it says "you have found the north mountain wall, you can go west or east from here" Then if they go east, they will eventually hit the "zone" for the "castle" place with a narrative story. The zone to the castle will be a vertical line from points on the mountain end wall points. does that sound decent? Quote Link to comment https://forums.phpfreaks.com/topic/263857-xy-coordinate-system-for-game-areas-question/#findComment-1352162 Share on other sites More sharing options...
KevinM1 Posted June 8, 2012 Share Posted June 8, 2012 Sounds good. Play with it to get a feel for it, and don't be afraid to ask more questions if you need to tweak the design. Quote Link to comment https://forums.phpfreaks.com/topic/263857-xy-coordinate-system-for-game-areas-question/#findComment-1352165 Share on other sites More sharing options...
codenature Posted June 8, 2012 Author Share Posted June 8, 2012 Great thanks again. This is fun now that I have the plan. Yay! Quote Link to comment https://forums.phpfreaks.com/topic/263857-xy-coordinate-system-for-game-areas-question/#findComment-1352171 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.