Still waiting on Seed 'n Breed (Patreon)
Content
It's the Christmas break and Steam is likely short-staffed, so I'm not worried. Seed 'n Breed has been approved, just waiting on the store page. Game will be for sale on Jan 15.
Spent the week working on "Snow Bound". Re-aligned all the art, drew snow layer on all the objects, added the snowing animation, and got snow paths working! This was a challenge. Mainly because I wanted to do it as efficiently as possible. Here's an image first:
I was extremely pleased with the snow paths. You can't really see it in the image but it follows the mans closely! Next week I have to get the man walk animation working... and not looking forward to that... Maybe, I'll work on the inventory first. LOL.
If you actually care about coding the rest of the post just blabbers about how I decided on designing the snow paths: The easiest way to do it would have been to track which edge of the tile the player leaves, save all 4 edges in an array, then draw the snow path based on the array. But that means I would have to save an array of 10,000 booleans, most of which would be empty. Second idea was to have an expanding array only save the tiles and direction that the player entered. Then draw the path as it read the array. The problem there is if the player walked over the same tiles multiple times (like near your base) the game would be drawing needlessly. Also, any tiles off-screen would be processed needlessly as well. Also, I would need to have all 16 path images saved to load the correct one when needed.So, the final approach was to assign a number to each of the 16 possible paths, then when the player leaves a tile, check the current path, add the exit direction, save that number, then do it again for the tile he enters. Loop through all 4 possible directions, then draw needed ones, of the snow path. Do this both when player exits and enters so the drawing "follows" the players feet position. The beauty of this strategy is I only need to save the 4 base direction images, instead of 16, and only need to save 2500 variables, instead of 10,000, because the code deciphers the directions for me! Here's the code: