DEV_LOG (5, 07/11/22)


On the agenda for this week, I decided to focus on the next major feature of the game, the inspectable objects. Starting out I created yet another custom sprite class to contain most of the logic.

Inspectable Object Logic

Back in the game’s update function, I then got the interact control key working, using proximity checks rather than an overlap function so that I could have more control over how close the crosshair and the player has to be for an interaction to be successful.

Interact Logic

Next up, I wanted the inspectable objects to come in and out of view depending on the player’s proximity to them. To achieve this I implemented a linear interpolation that updated the alpha/opacity value, with A being 0, B being 1 and the player’s distance being used as the alpha once they’re within 100 units.

Inspectable Alpha Lerp

Rounding things out I implemented checks for the win/lose conditions, creating a complete game loop.

Win/Lose Conditions

Leave a Reply

Your email address will not be published. Required fields are marked *