Week 7 Game Dev Class: Exploring Unity's Universal 2D Tools
This week in our game development class, we took our skills further with Unity's Universal 2D tools. Although we’re learning remotely, the hands-on approach allowed us to really explore how to make our 2D game more visually appealing, interactive, and engaging. Here’s a breakdown of what we covered:
Universal 2D Features: Adding Lighting to 2D Games
We explored the Universal 2D Render Pipeline in Unity, which is great for adding lighting effects to 2D games. This is a game-changer because 2D games don’t traditionally have built-in lighting. Using Universal 2D, we can add lights to specific areas, such as player paths or background elements, to create atmosphere and depth, making the game world feel more dynamic and immersive.
Player Controller and Horizontal Input
Just like in our first project, we focused on refining the Player Controller. We used Horizontal Input to allow the player to move left and right using the "A" and "D" keys or the left and right arrow keys. This feature provides intuitive movement for the player character. Unity’s default input system makes it easy to integrate these controls, though we can also customize inputs if we want a different setup in the future.
Ground Detection and Tags
We learned a key concept in making the game’s movement feel real: ensuring the player can only land on designated “ground” objects instead of any random surface. To make this happen, we used tags and names in Unity, allowing the player to detect specific objects like “Ground” or “Platform” and land only on those. This simple change can make player jumps and landings more consistent, enhancing the gameplay experience.
Double Jump Mechanic
One of the exciting mechanics we learned to implement was double jumping. In Unity, this effect lets the player jump once in the air after the initial jump. It’s a popular feature in platformer games that adds extra mobility and control for the player. Limiting the jump to only once in the air means the player can’t jump indefinitely, keeping the mechanic balanced.
Using Cinemachine for Smooth Camera Control
Through Unity’s Cinemachine package, we added smooth camera movement to our game. Cinemachine is ideal for 2D games, as it allows the camera to follow the player with added transitions, damping, and framing options. This feature keeps the player centered and the game visually consistent, adding a layer of polish to the visuals. We downloaded Cinemachine through the Package Manager in Unity, which gave us access to its range of camera tools.
Triggers and Animations for Interactivity
We explored how to use triggers and animations to make the game environment feel more alive. For example, we set up an area that, when the player enters it, automatically closes a door. This kind of environmental interaction can enhance immersion and also be used for gameplay elements, like creating challenges or hidden rooms.
Collecting Coins
Finally, we implemented a basic coin-collecting mechanic. Players can now collect coins as they move through the game, with each coin triggering an animation or a sound effect. Adding collectibles not only adds excitement but can be used to track player progress or provide in-game rewards, adding depth to the game’s experience.
Wrapping Up
This week’s lesson introduced a variety of new techniques, from lighting and camera control to movement mechanics and interactive elements. By layering these features, we’re building a game that’s both functional and visually engaging. As we continue developing, I’m excited to integrate these techniques into our projects to create a polished, immersive experience for players.
Comments
Post a Comment