Candy Crush Remake

About Candy Crush

School exam.

Recreate the original mobile game Candy Crush!.

My Candy Crush remake is a reimagining of this classic game, built in C# to demonstrate my skills. The project replicates core mechanics.

Candy Crush is a popular match-three puzzle game originally developed by King. The game challenges players to swap adjacent candies to create matches of three or more of the same color, triggering chain reactions and earning points. With a variety of levels, power-ups, and obstacles, Candy Crush is known for its addictive gameplay, colorful design,and engaging mechanics.

Project info

Descrizione dell'immagine 1

1

Descrizione dell'immagine 2

April 21th - may 10th, 2023, three weeks

Descrizione dell'immagine 3

Unity

Descrizione dell'immagine 4

Windows

Home Release

Introduction

This project marks my first foray into game development using Unity and C#, created in 2023. It showcases my journey into understanding core game mechanics, such as state machines, grid management, and dynamic game logic. Inspired by the famous Candy Crush game, I implemented a match-three game loop that reflects my growing proficiency in C# programming and Unity's powerful game engine. This project is a testament to my learning process, experimentation, and passion for creating engaging and interactive games.

Difficult

One of the main challenges I encountered while developing this project was the creation of the grid system, which was my first time implementing such a structure. I had to ensure the grid dynamically updated, responding to player interactions while keeping the game logic clean and efficient. Handling the candy positions, making sure that no candy would overlap or be placed in incorrect cells, was tricky, especially when ensuring smooth transitions and that candies always fit within the grid boundaries. Another significant challenge was building the state machine, as it was my first time implementing this design pattern. Managing the different game states (like swapping candies, checking combos, and refilling the grid) and ensuring the game moved between states without errors was complex. At first, managing these state transitions felt overwhelming, but it ultimately helped me organize the game logic and make the entire gameplay experience more structured and modular. Finally, managing the candy movement between grid cells was also a challenge.The candies should not only move visually, but also have their positions correctly updated in the gameโ€™s logic. These challenges, though tough, provided valuable learning experiences and allowed me to better understand state management, animation, and dynamic game mechanics in Unity.

Game Core

This project showcases a state-driven game loop built in C# using Unity, designed for a Candy Crush-style match-three game. The system is structured around a state machine architecture, ensuring smooth gameplay and efficient game logic execution.

๐Ÿ”„ State Machine Architecture

  • SwapCandyState โ€“ Handles player input, allowing candies to be swapped and validating whether the move is legal.
  • CheckCombosState โ€“ Detects and processes valid matches of three or more candies.
  • ReFillState โ€“ Refills the grid by introducing new candies while ensuring no empty spaces remain.
  • StateManager โ€“ Orchestrates transitions between states, ensuring smooth and automatic progression based on game logic.
center

Grid

The grid system dynamically updates based on the playerโ€™s interactions and game logic. Key functionalities include:

  • GridControllerManager โ€“ Maintains the logical representation of the grid, tracking candy positions and updating the board after every move.
  • GridManager โ€“ Spawn the grid with custom size.
  • RefillManager โ€“ Adds new candies into empty slots while preventing infinite loops and ensuring no immediate matches occur upon refill.
  • CheckComboManager โ€“ Detects and processes valid matches, applying effects like cascading combos, special candy activations, and score multipliers.
  • CandySpawner (ScriptableObject) โ€“ The candies are spawned using a ScriptableObject, which contains all the possible candy types. This allows for easy addition of new candy types and customization of candy attributes.

This system ensures high performance, preventing unnecessary calculations while keeping the game responsive. It also supports dynamic board sizes and different candy types, making it adaptable for future game expansions.

This modular and scalable game loop serves as a solid foundation for any match-three puzzle game.

center

Let's get in touch!

Feel free to reach out! Whether you have a question, a project idea, or just want to chat about game development, Iโ€™d love to connect.

Email:

Discord: Lollo48#2497

*Based on : work illustrations @iluskaland 2024

*Thanks for the illustration: work illustrations byStoryset

*Thanks for the icons: flatart, font awesome, microsoft, chanut is indurstries, kalash on Iconfinder