Weapon Implementation (R Blog 3)


Author: Robert McGhee

Weapons are an important part of any game with combat, and we needed to figure out how to add the melee weapons we wanted into our game. Implementing them was interesting, since some models were oriented in the opposite direction of the other models, causing them to appear backwards when they appeared in our game. We also had to decide between having one Base Weapon class that each weapon was a child of or adding separate weapon classes for each weapon type instead. 

To make adding more weapons of the same type easier in the future, we chose to make each weapon type a class that inherits from our Base Weapon class so they could have different implementations with the same base components. As for the flipped models, we created a toggle in the Base Weapon class that tells the player whether the weapon should be flipped or not after being equipped. This also allows us to easily flip the orientation of a weapon if it looks better that way later on, such as holding a dagger with the blade down versus with the blade up.

Get Blind Spot

Leave a comment

Log in with itch.io to leave a comment.