Devember Day 30
I added another improvement to the game's realism today, by requiring the player to face trees to chop them down. This can be done by a simple check of which direction the player is facing and to which direction the tree is.
I then disabled buttons, which required a bit of a rework of how I handled button clicks. The need for this feature arose while I was thinking about adding a save/load feature. I will likely have a "Resume Game" button in the main menu, along with a "New Game" button. If you don't have any previous saves, then the "resume game" button should be disabled. It's not the prettiest thing ever but here's what I'm using at the moment:
function buttonClick(button: string, event: MouseEvent, callback: () => void) {
if (get(button).className === 'button enabled' && clickType(event)===ClickType.LMB) {
callback.call(this);