Sarah Reen - Week 8 Devlog
Programming - 6 hours
I continued my work on implementing the Interaction System which will be vital in implementing the various Gizmos and "Gadgets." Gizmos refer to the 4 main objects the two players will be interacting with (Lever, Button, Crank, Slider), and Gadgets refer to the objects that are affected by those Gizmos (Door, Laser, Air Turbine, etc.) When a player interacts with a Gizmo, it needs to do two main things:
- Retrieve Data about the Specific Gizmo the player has interacted with and update the value of it
- Retrieve Data about the Specific Gadget the Gizmo will be affecting and update it with the given value from the Gizmo
All Gizmo Objects Inherit form a base Parent known as InteractableBase. This class sets up the needed functions for what is required in Step 1. It sets up an interaction event and then updates its value based on that specific interaction event. It then calls another function that Updates the Specific Gadget.
However, we will have several different types of gizmos that all have unique attributes and characteristics. It would be better to place that logic in its separate script that inherits from InteractableBase. This keeps our code clean and organized, without running the risk of certain objects having access to things they shouldn't have. For example, in the Lever Script, it can update its value to either 0 or 1; the only two values that it can have are reflected by the Up or Down state. But in comparison, the Crank Script updates its value between a range of 0 to 1 based on the position of its child object in a 360-degree rotation.
We then need to retrieve data about the specific Gadget that we want to update given the value of the Gizmo. This is done similarly to how we retrieve the Gizmo: with scriptable Object. When interacting with an object, the InteractionBase searches for the Gizmo Data of the given object. It then populates itself with that data to perform certain functions successfully. The InteractionBase will also then have to search for the relevant Gadget Data based on several properties such as which wire the gizmo is attached to, and what Gadget is also attached to that wire. This part of the script is still a work in progress.
Get Spit It Out!
Spit It Out!
Status | On hold |
Authors | William Baran, Sarah Reen, gjones50, JazzyJems, A. Weis, SEGAGENESISDOOD |
Genre | Puzzle, Platformer |
Tags | 2D, Co-op, Pixel Art, Short, Unity |
Languages | English |
Accessibility | Subtitles |
More posts
- Andrew Weisberg - Week 15 DevlogNov 30, 2023
- William Baran - Week 15 DevlogNov 30, 2023
- Tolu Kolawole - Week 15 LogNov 30, 2023
- Sarah Reen - Week 15 DevlogNov 29, 2023
- Elisa Kucalaba - Week 15 DevlogNov 29, 2023
- Sarah Reen - Week 14 DevLogNov 22, 2023
- Tolu Kolawole - Week 14 LogNov 22, 2023
- Elisa Kucalaba - Week 14 DevlogNov 22, 2023
- William Baran - Week 14 DevlogNov 21, 2023
Leave a comment
Log in with itch.io to leave a comment.