zFRAG is a little Zen Game in which you can manually defrag a virtual Hard Disk. You can also turn on the AutoDefrag and sit back and watch.
Developed in Unity, the game is available on itch.io
I strongly suggest you to download the project as a whole and run it in Unity yourself. Although I did my best to make the logic self-explanatory, there are things that are only understandable by looking at how they are implemented in the Editor.
Examples being: initial values for some variables, Button Events and Graphics, AudioClips.
The game's reference resolution is 640x400. I made use of the 2D Pixel Perfect package.
I only used TextMeshPro
components.
The Atlas for the specific font I used (PxPlus_IBM_VGA9) has been set up in such a way to include all of the "special" characters (i.e. Block Elements to represent sectors) I needed.
To handle AudioClip
s volume I use Audio Mixers.
If you want to know more about Audio Mixers I suggest you to give a look at these tips.
As you can tell, I tried my best to emulate a DOS-like interface. Each Button in the game has a MoveTextOnClick
script that shifts the Button's Text component to the right upon click, so to follow the Pressed Sprite
and the default one.
The main game logic makes use of a Finite State Machine with 5 states: START, DEFAULT, AUTODEFRAG, FREEPAINTING, COMPLETE. When Players either hit ESC to display the Exit Menu
, or are in the Options Menu
, time doesn't advance.
Only available upon starting the game. This switches to DEFAULT once players close the Start Menu
.
Time doesn't advance.
The default state in which players can operate, after closing the Start Menu
and when AutoDefrag
and Free Painting
modes are switched off.
Here players can drag and drop sectors in order to form a continuous line from the first cluster of the grid.
After placing a sector, the game will update the grid and the Progress Bar
to check if there are new sectors to be considered defragmented.
If there are, the game "paints them" yellow and makes them unmovable.
Time advances.
The grid is updated in the same way as in the DEFAULT state, but here the game does so automatically at a given speed (modifiable in the Options Menu
).
Here players can't interact with the grid.
Time advances.
Here players can freely drag and drop sectors wherever they want without having the game preventing them to do so, as this time it won't check for defragmented sectors.
Defragmented sectors are all in a row. Players can't move sectors again unless they Reset
or switch to FREEPAINTING.
Time doesn't advance.
The hard disk sound effects have been edited from a small recording I took of the wonderful audio of the TwitchDefrags stream.
The sound you hear when dragging and dropping sectors on the grid was made using Bfxr by Stephen Lavelle.
The font - PxPlus_IBM_VGA9 - is part of the Ultimate Oldschool PC Font Pack © 2016 VileR, and is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
I modified, according to my own purposes, the code provided by this tutorial by Omnirift.
Thanks a lot to the Multimedia HyperGuide community who have been the first people to know of this little project of mine and provided feedback, support and suggestions along the way.