top of page

Fruit knight

Engine: Unity

Language: C#

Time: 2 weeks

Team size: 6

My role: Gameplay, UI

Map system

One of the main things I worked on was the map-system. The player can create your own maps by writing a simple txt-file with 'X's and 'O's, to place walkable and unwalkable tiles on the map.


I took inspiration from the A* pathfinding to determine which kind of sprite should be placed since the walls needed to connect smoothly.


The script reads a text file, translates each char into a point on a 2D grid, and places a specific sprite depending on its neighbours. 

Screenshot 1.png


The system is set up by two scripts. The first one is the Tile class that holds the information of each tile on the map, i.e. if the tile is walkable, the  XY coordinate and if it contains a  pickup.  

Shown Tile.cs


The second script is the Grid class, the script reads the map files and draws the map according to the text files in the project folder.

Besides reading the files, it also determines which sprite to set depending on that tile's neighbours and their status (walkable state and position). 

The SpawnFollower function randomizes spawn locations for pickups and enemies. 

Show Grid.cs
Screenshot 3.png


I also contributed with some UI work, mainly the high score.

The player's high score is saved on the computer meaning the score get carried over between sessions.  

Show UI code

Other projects

bottom of page