Game-Design / Sprint2 / Sprint2_actual / Rithvik Code Review Maintainability.txt
Rithvik Code Review Maintainability.txt
Raw
Rithvik Potluri
10/3/2021
Sprint 2
RightArrowSprite.cs
Zach Jones


Zach wrote the RightArrowSprite.cs file to provide implementation for link being able to shoot an arrow when the 1 key is pressed. This class starts off by declaring all the public and private variables that will be used in this class. Then the constructor sets each of the variables with an initial value, which is great practice and is the model way most classes should be set up. In the draw method he created a source and destination rectangle to grab the sprite from the sprite sheet and display it to the screen. The update method then determines when the arrow should still be drawing and when it should be done. With a focus on code quality, this class was written well and had good coding mechanisms. All variables were declared at the beginning of the class and were then initialized in the constructor, which makes it easy to change if any changes are necessary. In the draw method the source and destination rectangles were also declared before being initialized. One thing I noticed however that could make this code more maintainable is that in the else statement for the source rectangle initializing there are hard coded values for the pixel coordinates of the sprite. For best practice, these values should be stored in variables so that there is a single point of control so if those values change in the future only the variable value needs to change instead of every instance in which that value is hard coded. The hypothetical change I would suggest is to take the hard coded values discussed above and store them into variables. This change would be very easy to implement the way the code is written.  Overall, this code is very maintainable and easy to modify.