1. Lost Twins 2
  2. News
  3. Devlog # 55 - Water movement inside a piece

Devlog # 55 - Water movement inside a piece

Hi guys!

In the previous devlog, we shared insights into the intricate mechanics of water flow. This time we delved deeper into the evolution of these mechanics by introducing a new functionality that empowered players to manipulate water movement between specific points within a piece. This enhancement not only elevated the gameplay experience but also encouraged players to engage in creative problem-solving as they navigated through the puzzles.

The newly implemented feature allowed players to direct the flow of water in both horizontal and vertical dimensions. This dual-directional movement was contingent upon the initial movement direction set for the water, providing players with a broader range of strategic options. The ability to control water flow in multiple directions significantly increased the complexity of the puzzles, challenging players to think outside the box and devise innovative solutions to advance through the game.

To facilitate this functionality, the development team defined two Vector3 variables: one to store the water's current position and another to hold its target position. This decision was crucial in enabling smooth transitions as the water moved across the game environment. When a player pressed the pressure button, the MoveTowards function was activated. This function was designed to guide the water from its current position to the designated target position, which was predefined in the inspector. This setup ensured that the movement was not only fluid but also predictable, allowing players to plan their actions with confidence.

The code snippet below illustrates how the movement was executed:
if (canChangePosition)
transform.position = Vector3.MoveTowards(transform.position, wantedPosition + myPieceHoverGroup.position, MyTime.deltaTime * speed);

Upon releasing the pressure button, the water return to its original position, providing a satisfying feedback loop for players. This return mechanism ensured that players could experiment with water movement without fear of permanently altering the game environment, thus fostering a sense of exploration and creativity. The design choice to revert the water's position reinforced the idea that the puzzles were designed to be solved through trial and error, encouraging players to learn from their mistakes and refine their strategies.

The use of the Vector3 type for the wantedPosition variable was particularly significant, as it allowed for adjustments to both the X and Y values. This flexibility meant that players could effectively control the water's movement in either direction, whether they aimed to navigate the water horizontally across the screen or vertically up and down.

Here’s a video to visualize this new functionality in action:

[previewyoutube][/previewyoutube]

See you next time!

Best regards,
Playdew Team

https://store.steampowered.com/app/1752540/Lost_Twins_II/