Relationship Interaction Screen
Introduction
To expand on the previous post's idea of relationships, I needed to create a way to interact with peeps around town. To do this, I needed another layout (let's call it relationshipInteraction), which would give the player options to interact, as well as showing additional information about the peep.
Design
The design for this screen was shown in a previous post, and looks like this:
This includes a numbers of features, such as the:
- Portrait of the peep
- Basic information (name, age, occupation etc.)
- A button (?) to view additional information (not yet implemented)
- The relationship with the player
- An indication of the peep's recent behaviours (shown in a thought bubble)
- And several interactions which would be in a scrollable menu
Implementation
I used the previous relationship screen as a base, as it has similar features. Many of these features are just static objects and as such, could be rendered directly to the screen.
The interaction menu relied on the same function as the relationship screens scrollable menu. It works by predicting the touch movement with trigonometry and then tweening to the position.
Static Objects
The idea of having a thought bubble, which would display the peep's mood was something I came up with early on. I like the idea of having the peeps feel alive by giving them moods, and corresponding thoughts. The text here is decided on a number of queries, such as whether they are employed, their age etc. This makes the text relevant to them.
Interactions
Different peeps will have different interactions available. To accomplish this, I decided to create a function which would run through several queries checking against certain variables. For example, I asked the question "is the peep employed?", if they are, then the interaction "go to workplace" can become available.
These interactions were then loaded to another array which would later be iterated and loaded to the screen. This ensures only suitable interactions are displayed, whilst reducing the complexity of the code.
Example of the behind-the-scenes format of each interaction |
Each interaction would be stored as this lightweight string (dash separated values (DSV)), which displays the ID of the interaction, the text displayed, colour (which is stored in a dictionary) and icon.
This means that implementing these interactions in the future will be a lot less hassle, but as for now, there is only 1 interaction in the game.
In Action
I have attached a video showing the new screen, as well as how an interaction would work:
Comments
Post a Comment