This weeks tutorial was intense. It made me remember a lot of the more intermediate programming practices I knew back in high school as well as teach me a lot of new concepts.
The goal was simple – to create a moving object script, that would serve as a foundation for all moving units in the game. Taking advantage of inheritance, the core pathfinding would be the same and each different kind of character would have their own implementation of movement. This makes the code much more scalable and cleaner.
What was interesting was some optimizations in pace, for example have an inverse of the movetime so that we multiply instead of divide, which is more efficient in terms of computing power. I also had to refresh my knowledge on inheritance, singletons, layer masks and such. It also introduced a bunch of brand new concepts, such as protected virtual functions, which can be overridden by the inheriting classes. Another useful thing was passing in generic parameters, that can be defined and flexible. This was something that I had always wondered about but never quite knew how to implement.
No images this week, because I am kicking it into high gear and focusing on getting this tutorial done so I can begin work on my own game.