About
Here's my assignment for the end of the Mobile Development module.
Assignment characteristics:
Recreate the original mobile game Sandwich!.
Sandwich! is a casual mobile puzzle game where players stack ingredients to create sandwiches.
The goal is to fold different layers of ingredients in the correct sequence, stacking everything from cheese to vegetables and meats, until a complete sandwich is made.
Simple swipe controls make it easy to fold the ingredients over each other, but careful planning is required to avoid mistakes.
Project Info
![]() |
Team Size: 1 |
![]() |
Time Frame: 1 weeks |
![]() |
Engine: Unity |
![]() |
Platform: Android |
Game Loop
- The GameManager initially loads the PauseState, within which it waits for the player's input to start the game. Additionally, at the game's start (in the Start of LevelLoader), the first level is already instantiated.
- Once the player provides the input to start the game, the state transitions to PlayState.
- Entering PlayState enables the SwipesManager, which handles reading player input to move various elements on the game grid.
- For each valid move made, the win condition is checked; if satisfied, the state changes to WinState.
- Entering
WinState disables the SwipesManager and waits for the player to input a command to proceed to the next level. - Once the player inputs the command to advance to the next level, it returns to PlayState.
- Upon exiting WinState, the LoadNextLevel event is triggered. In this event, the LevelLoader loads the new level (using LevelGenerator to generate random levels whenever it's triggered), and all elements of the previous level's grid self-destruct.
Stack Animation
Definition: from = stack to be rotated (Target Stack);
Definition: to = stack that receives from.
Definition: stackCount = height of the stack.
There are three possible animation cases for a Stack:
- stackCount_from == stackCount_to;
- stackCount_from < stackCount_to;
- stackCount_from > stackCount_to.

The StacksAnimator is the class responsible for calculating the Starting Point, Ending Point, and Rotation Pivot, and performing the movement of the Target Stack using a classic state pattern after calculating the necessary data.