2 Replies Latest reply on Oct 10, 2012 9:07 AM by kglad

    Tile Based Map Problem

    robi90

      Hello (:,

      I am making a 2D platform game, and the levels are made with tiles. My levels are slightly big for the computer to render all the assets at once. So I came up with some obviously technique that renders only the parts of the map that the player can see and it was a big success. Only one problem occur... the tiles are heavy detailed so I'm using the cacheAsBitmap (true) to render them, and the FPS have improved much in my game. But then occur something weird. There is slightly spaces among the tiles that only happens if I'm using the cacheAsBitmap property (without it I'm lost..).

      I made two demonstrations of the problem. You cant notice to FPS problem here cause it's a very simple tile (and of course the game is heavier) :

      (You can move with Arrow Keys)

      With cacheAsBitmap = true:

      http://megaswf.com/s/2488994

      Without:

      http://megaswf.com/s/2488997

      Here is the fla with the cacheAsBitmap. So if you want to change it just go into the code in the vcam timeline:

      http://www.sendspace.com/file/8mry51

        • 1. Re: Tile Based Map Problem
          prodigalmaster Level 2

          Make the tiles a pixel or two wider and higher. In vector, with quality set to low, this is also the case if the blocks are snuggly fir together and moving. Each tile doesn't move at the exact same time (even though it should) and so for example when one moves 1 pixel left, there is a 1 pixel wide gap until the second tile moves 1 pixel left.

          edit: I just took a look at those files and I see there are lines even when it is not moving. I also realised you probably do not want to make the tiles any larger as this could cause errors in code and other problems.... Other than what I suggested, I do not know a way to fix those tiles. Are you sure the vector versions do not have a black line surrounding the blocks?

          edit2: Also, have you tried making the tiles bitmaps before run-time?

          • 2. Re: Tile Based Map Problem
            kglad Adobe Community Professional & MVP

            use integer sized tiles and place them on integer x,y.