View Single Post

Old 05-29-2016, 12:38 AM   #3
SapreaverTwo
Crab Defiler
 
SapreaverTwo is offline
Join Date: May 2016
Posts: 53
Default

As for implementation for the adventure changes. I'm not sure how you have your database set up storing character information. But on each character record add a new column coresponding to whether they've entered a square it can be a string.
In client load in the string to bool area set up as such (boolean explored [map height] [MAP WIDTH] )
Have each default to 1 and as you move it preforms a check. Comparing player x/y cords to the the new spot on the array. Like so.
If( explored [player.gety ()][player.getx ()] ) {
GIVE ADVENTURE EXP;
EXPLORED [PLAYER.GETY ()[PLAYER.GETX ()] = false;
}
There are functions to output arrays as a string that can be easily stored in a database as well.
  Reply With Quote