
Scripting/Functionality ()
I have created hundreds of scripts for my unity projects, all using Visual Studio and C#. Below are some excerpts from my repertoire which demonstrate key features/functionality which I've been able to implement into my games.



When scripting, I always make sure to implement plenty of comments and tooltips to make it easier to spot and understand the functionality of various lines/methods. This is helpfull for myself when looking back and also for others who may want to make additions/tweaks.
​
I've learnt how to effectively use various AI models to speed up code writing and address bug fixes. Key aspects of getting AI's to be instrumental in my work are to give full context of the functionality you're trying to create and carefully monitor the suggested code which they provide. Models which have proved most usefull so far are Gemini and Grok. Both have enabled me to add entire new systems such as inventory in a couple of hours.

When writing code for my tower defence game I came across several challenges as I developed more complex enemies and systems. One such example as shown in the code below and video to the right was as relates to an enemy in the game called a Cookie. The Cookie is an early boss enemy which will have pieces break off as it's damaged and become Bits, smaller enemies. I handled this in the code via health phases. However, these new enemies prevented the level from ending as the script did not communicate with the game manager for when they were destroyed. As a result I added references to the game manager script and ensured to increase/decrease the EnemiesAlive variable as appropriate, allowing the new functionality to work seemlessly with the games level end logic.
Above is an example of a tree set up script which I created to assign components to my terrain instantiated trees so that I could develop an open world surviver game similar to the likes of rust and valheim. After employing this script all trees became equipped with box colliders, falling animations, falling sounds + effects. At first, this caused some performance issues as each tree was instantiated, it took a load on the GPU. As a fix, I implemented a system which processed 10 trees per frame as apposed to batch all at once and on a revisit, when tidying up the system, I noticed that almost all performance drain was attributed to activating the animator components. And so I altered the code once more to only activate that component upon the tree being struck. A video example of this script in action is below from my project.

