Hello,
Being new to Unity, I decided to start a simple project and recreate an 'old' game of mine using tile maps.
http://greatflash.co.uk/index.php?topic=471.0This was a complete Boulderdash ripoff coded for the old Psion 3a computers and released by Yellow Computing. I know it is basic, but... it was a good starting point and gave me a chance to play with the 2d toolkit.
After less than 10 hours playtime, I have test levels that can be fully played, scrolling larger maps, and all the main code in place (though all within the player script until I work out a good way to split it all up).
Anyway, onto the question...
Currently, all objects move and fall a tile unit at a time (much like Boulderdash did), but... I want everything to move smoothly. ie. To have the boulders fall in pixel units rather than the 64x64 pixel tiles.
This I cannot find a solution to? I can see no way of offsetting a tile by pixels in x/y. This would be a solution as I could change the offset per frame and when it reaches the destination (a total of 64 pixels), I can then move the tile in the tile map.
I did attempt using prefabs as this offered the ability to offset them from origin. But... This looks like it would be rather intensive computationally. ie. the map is a max of 40x40 tiles. I iterate over that map from the bottom right to the top left. The only way (i can see) to find out what prefab is at a location is, for every tile I find, to iterate through the prefab list looking for a map (there could be a prefab for every tile). This it a lot of looping in a single frame.
So, Does anyone have a solution or any ideas that can help me realise my goal?