Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - greatflash

Pages: [1]
1
Support / Re: Enhanced tilemap manipulation
« on: December 10, 2013, 04:06:57 pm »
Thanks for the reply.

Using prefabs could be the way to go, my only concern was the overhead involved in finding which prefab is at what tile location. Or am I missing something?

What would have been nice would have been the ability to offset a tile in X and Y. The tile would still be at it's original coordinates internally, but displayed with an offset. If the offset could be polled as well, it would open the tile maps up for the more adventurous with the ability to use the offsets alongside any detection code.

Oh, and it would solve my little problem lol... ;)

2
Support / Enhanced tilemap manipulation
« on: December 09, 2013, 10:28:42 am »
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.0

This 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?

Pages: [1]