Fruit Slicer is a lightweight Unity project that implements a simple fruit-slicing mechanic similar to popular mobile arcade games. Fruits are spawned and the player slices them by dragging a blade across the screen. Bombs appear occasionally and must be avoided!
- Swipe-based slicing using a
Bladecontroller. - Fruit spawning and variety (
Spawner). - Simple game state management (
GameManager). - Fruit and bomb behaviors with collisions and effects.
- Prefabs and materials for fruits, bombs, and the background.
- Unity 2020.3 or newer.
Assets/Scenes/— Unity scenes (MainScene).Assets/Scripts/— Core gameplay scripts:Blade.cs,Fruit.cs,Bomb.cs,Spawner.cs,GameManager.cs.Assets/Prefabs/— Fruit, bomb, and base prefabs.Assets/Materials/,Assets/Textures/,Assets/Models/— Visual assets used by prefabs.
- Install Unity.
- Open Unity Hub and add the project folder: the root of this repository.
- Open the
MainScenelocated inAssets/Scenes/MainScene.unity. - Press Play in the editor to run the game.
- Click and drag the mouse to move the blade and slice fruits.
- Avoid slicing bombs.
Blade.cs— Handles user input, blade movement and slicing trail visuals.Fruit.cs— Fruit behavior, splitting logic and score events.Bomb.cs— Bomb behavior and explosion handling.Spawner.cs— Controls spawning frequency, types, and spawn patterns.GameManager.cs— Tracks score, lives, and overall game state.
- Open
File > Build Settingsin Unity. - Add
Assets/Scenes/MainScene.unityto the Scenes in Build. - Choose a platform and configure player settings as desired.
- Click
BuildorBuild and Run.
