In Flag Collector, the player creates a path for the flag collector to follow and gather flags. At any time, the player can change how the flag collector approaches the flags—choosing to target the closest flag, collect them in a specific order, or pause the game to plan and place flags strategically. This mechanic adds flexibility and strategy, making the gameplay engaging and dynamic.
Created In: 2021
Collaboration: Made it Myself – Solo
Link to Play the Game:
m4tin – itch.io
Game Engine: Unity- C#
State Controller:
The State Controller manages the flag collector’s behavior through three distinct states: In Order, Nearest, and Paused. This is achieved by storing the flags’ locations in an array, allowing the system to dynamically adapt based on the selected state.
This system adds flexibility and ensures smooth transitions between behaviors, enhancing player control and engagement.
Following and Rotating
I implemented basic vector math for the flag collector to navigate toward the flags. The dot product is used to calculate the rotation angle, while the cross product determines whether the flag collector should rotate clockwise or anticlockwise. This approach ensures smooth and precise movement as the collector follows its path.
Flag Planting:
Flag Planting
In the game, I implemented a distance check to ensure that players cannot place flags too close together or directly on top of each other, encouraging thoughtful flag placement. Additionally, I incorporated a fade-out animation for the UI using Unity coroutines, adding a polished and visually appealing transition effect to enhance the player experience.
Device Support
– The game build is WebGL and runs on web browser.
– Click here to play the game.
Unity packages
– Cloth animation-based Flag by telecaster (from unity asset store).