When it comes to game development animation and programming are what I consider my shortfalls. I can script, given enough time I can script some complex mechanics. But I'm no programmer.
If I don't programme for a long time I tend to forget how their relavant syntax works, which is annoying. And because I havn't used Unity for a good long while I'm having to learn the ropes again.
Last time I used Unity, they were using their own mono editor with Java, which I was quite proficient in. Since then, they have shifted entirely to C#.
At any rate, I'm gradually getting better with C#, I've managed to create 2 important scripts and even UI elements:
Coins:
I've had coin placeholders in the game for a while now, but that's all they were. I have now made them fully functional and can now be collected and even update the UI to reflect this.
The rational behind this was to create a collection script on a global object, this script tracks what coins have been collected and since the object is persistant in the stage, theres no way the information can be lost.
For each coin, I had them check when a collision happens, if it has collided with the player, if so then check what coin colour it is and then add to the players coin collection script. At the same time, the code that governs the UI checks every frame the state of the players coin script and updates this on-screen.
Buttons:
In the original game there are a couple of buttons that open up new pathways. I obivously needed to recreate this mechanic. Originally they change from green to red during any cooldown.
I created the same but added more functionality. Because Unity's editor allows for on the fly variable editing via the inspector I coded the option to change the colour via a dropdown box. So any buttons that are placed within the world can have their colour changed immediately without hassle.
I'm particularly proud of this because it uses an enum list coupled with a switch case and finds any child objects and changes their colours too!
The button's trigger code also takes advantage of this new feature!
When the player collides with the trigger, it checks to see which trigger it has collided with and checks to see if it's not already triggered. If these conditions have been met, it changes it's colour and then will move anything (I need to add this later), the button will then wait for however long I've set it's individual timer for. After which it will reset it's colour, status and any object that needs returning to it's original place.
That's about it so far for mechanics, I'm enjoying scripting and look forward to implementing more!