Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMoBaT

Posted 07 February 2013 - 11:10 PM

So basically you have map files from like 1 - 100 let's say and each file is 20 x 20 tiles. Then you load the maps depending on the area they're at. 

What I tried doing was something like:
 

for (int y = playerYTILE - 10; y < playerYTILE + 20; ++y) 
{
  for (int x = playerYTILE - 10; x < playerYTILE + 10; ++x) 
  {
    //CODE
  }
}

 

But when I was walking, my character was moving faster than the map loading itself, which does not make sense to me since it uses the tile it's on. I could implement a chunk system, but spent some time trying to get this method working.


#2MoBaT

Posted 07 February 2013 - 11:10 PM

So basically you have map files from like 1 - 100 let's say and each file is 20 x 20 tiles. Then you load the maps depending on the area they're at. 

 

What I tried doing was something like:
 

for (int y = playerYTILE - 10; y < playerYTILE + 20; ++y) 
{
  for (int x = playerYTILE - 10; x < playerYTILE + 10; ++x) 
  {
    //CODE
  }
}

But when I was walking, my character was moving faster than the map loading itself, which does not make sense to me since it uses the tile it's on. I could implement a chunk system, but spent some time trying to get this method working.


#1MoBaT

Posted 07 February 2013 - 11:09 PM

So basically you have map files from like 1 - 100 let's say and each file is 20 x 20 tiles. Then you load the maps depending on the area they're at. 

 

What I tried doing was something like:
 

for (int y = playerYTILE - 10; y < playerYTILE + 20; ++y) 
{
  for (int x = playerYTILE - 10; x < playerYTILE + 10; ++x) 
  {
    //CODE
  }
}

But when I was walking, my character was moving faster than the map loading itself, which does not make sense to me since it uses the tile it's on. I could implement a chunk system, but spent some time trying to get this method working.

PARTNERS