snake game

This was the last game before we started with Pat and Martin (UH instructors). Personally, I think it is good and as we have worked out some of the glitches of it. However, now that I look back on this game's code, it can be shrunk down into more than half, and the game would be more efficient. For the purpose of showing you (the readers) our level, I have attached source code for the version which we were working with Mr.Genc at the time it was made.

In our code, half the functions (certain groups of lines that can be called to do certain things) were to ensure the movement of the snake. Under the class Snake, there are four functions for movement and eating (Move, Control, Collision, CheckEat), each one consisting of about 20 lines. Later, we found out that all of those code were the longer version of exactly one line (we were kinda mad).

We also made grids without know that there was already a grid system made, called Vector2 that uses an upside down version of the first quadrant of the Cartesian Plane. This way, the top left corner is (0, 0) and x and y increases as you move right and down, respectively. Click here to go back to XNA Game Studio