Code Rework

posted in KrisWolfe
Published March 28, 2019
Advertisement

I've been watching alot of videos on C# and the SOLID principles of coding. 3 weeks ago I had never coded in C#, and I've been learning swiftly. Last night I figured out Coroutines and how they work. I did not expect the rest of my code to run while the coroutine was running...I thought it was like a pause for the rest of my code. That has made me think of some interesting ideas, like cascading text.

Today I learned about delegates, and the lightbulb turned on. I realized how easy it would be to make code modular with delegates.

I also wrecked my UI by switching from constant pixel size to a reference screen size. I realized I just needed to restart,  using all the principles I've learned.

Today I redid my skilltree. My player, skill tree, skills, and stats are all scriptable objects now. I created a reset method to throw all the non-starting skills back into the locked List on the skill tree. I also have two different skills, Active and Passive that affect stats when unlocked. I created a debug screen with buttons that adjust the values of the scriptable objects and the player character. It's all wired up nicely.

Tomorrow we play around with delegates. I want each of my Systems to talk to each other through delegates, instead of hacking up some references through empty game objects like I was before. It will be interesting to learn about this new C# feature.

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement