Inspiration

I first decided that I wanted to learn the win32 API. As I began to learn it, I decided on the snake project because it targets one of my interests, game development, employs time-based features which I haven't learned before, and I also really loved playing snake on Cool Math.

What it does

Employs a window displaying a 25x25 snake game.

How we built it

I first defined the Snake class with basic features like what to do when your snake reaches an apple. Then I defined my window, a square drawing function that takes x+y values, and a message loop. The class and message loop interact with each other to make the snake program run.

Challenges we ran into

  1. Window wouldn't update after the first update.
  2. The snake went sideways after clicking the down arrow.
  3. Window displayed an error after the snake got an apple.
  4. Window didn't allow the snake to turn after getting an apple.
  5. Window displayed an error after the snake got 2 apples.

Accomplishments that we're proud of

  1. Making snake.
  2. Using win32
  3. Using a timer to make sure the window is updated every .15 seconds.

What we learned

  1. Win32 API
  2. The use of timers in C++ programs

What's next for Snake

  1. Make the snake stop moving after it dies.
  2. Scale the window to make the 25x25 grid a square.
  3. OPTIONAL: create a menu for the game that describes score, lives, etc.
  4. Stop visual bugs.

Built With

Share this project:

Updates