Refactoring ContextualBubbles - Part 1: Cooking Recipients
So when I implemented the egg cooking mechanic, I was just running against the clock, because I wanted Rafa to be able to cook himself an egg. You see, eggs are really important to Rafa, or at least, his character design chart said so xD
Originally, the egg was going to be the most complex food that Rafa could eat, and the coffee the most complex beverage. Eating an egg would give Rafa more stamina to stay awake during his work journey, and drinking coffee would give him an extra speed boost, but they are really time expensive so, eating egg + drinking coffee = a really mad boss xD
Something that started to bother me was the risk that the player would find the re-playability kind of boring, anyways one of the suggestions that Elaine, Andre and Jorge gave me during the pitch contest was that things could get broke, or give you a boost the next day so... I can play with this things to restrict re-playability of certain items and procedures.
Ok! back to the tech talk xD
Running against the clock while implementing this feature left me with spaghetti code, and now I am cleaning it up a little bit. First, let's start with the naming:
So the Hornilla owns the ContextualStove (this part is not new, that was the way it was implemented before the refactor), but what's actually new is that the ContextualRepresentation is now property of the ContextualRecipient, so when any ContextualRecipient touches an Hornilla (while is not being grabbed), it will become anchored to an empty game object that is part of the ContextualStove, and the ContextualStove will play an animation in said empty game object so the ContextualRecipient look like being put into the "contextual fire".
Removing the ContextualRepresentation was a bit of a challenge, because there is this animation on that empty game object that makes it appear as if it's getting dragged away, anyways, this piece of code gently handles it :3 (see _Unanchor () method)
The Pan is still not implemented, but the implementation will go smoooooothly, as soon as I implement the CookingReagents first o__o which I am planning to implement something like this
Get Hypnogogia (Demo, in development)
Hypnogogia (Demo, in development)
play and replay a regular day in Rafa's life: Help him eat breakfast, go through his horrible job, and return home!
Status | In development |
Author | pr00thmatic |
Genre | Simulation |
Tags | Exploration |
More posts
- Contextual bubbles refactor - Part 2: The food and PanJul 03, 2021
- Shoot just got real!Jun 30, 2021
Leave a comment
Log in with itch.io to leave a comment.