IDEA & DESIGN :

My idea for my final project was to create the game “WHAC-A-MOLE” using Arduino as a controlling system for the game. But because I wanted my game to be unique I thought I’d change the theme and change the game to “WHAC-A-VAMP” so whacking vampires instead (which if you ask me is way cooler). I chose a vampire because (not sure if I mentioned it in my first assignment or not, but I made a “vampire themed self-portrait??”)

Yes, she’s supposed to be a vampire. What do you mean she doesn’t look like one?

Anyways, so users whack my vampire self-portrait. Now that I think about it my idea is kind of problematic-

IDEA (but seriously):

For the game itself, I re-drew my self-portrait:

I was hoping I’d finish it completely to put the finished piece in the main menu but my program quit and only the sketch was saved. Basically, all my painting efforts have gone to waste and thankfully I screenshotted the face at least to include it in my game. This is what’s been saved ;-;

I use the same code for the stars in my dancing planets project in the background because I really liked it and I did not want a boring plain background.

APPLICATION AND CHALLENGES:

 

My game took much more time than anticipated. Whenever I tried to solve a problem a new problem arises. My highest streak of coding for this assignment was 10 hours straight! (not my highest streak for coding btw) But, it was definitely very exhausting. My main problems were the following:

 

  • Wiring problems (honestly I’m embarrassed that I faced them)

I did not know that I was not inserting my buttons correctly on the breadboard! The buttons were always loose, but I just thought it was how they were designed. So, when I run my program, I would think I pressed the button but it is just loose, thus I’d think it is a logical problem. I only fixed this problem after the professor pointed it out lol.

  • Logical problems

I faced problems because there would be loophole in my code that I could not see. For that, I needed a fresh pair of eyes to have a look at it and point out how to fix them.

My first problem was that when I would click to begin the game, the screen would go back and forth from menuScreen to gameScreen. I solved that by using boolean variables instead of using integer variables.

final int MENUSCREEN = 0;
final int GAMESCREEN = 1;
final int AGAINSCREEN = 2;
int screenState;

those were the previous variables and switching to boolean fixed it

  • Problems regarding functions I’m not familiar with

This problem occurred with the serialEvent function. Because I was not aware of how to use it properly, I used it like it is a normal function. And so, I would call it whenever I would call the drawGame function and that interrupted the button values from Arduino. The fix was to not call it, it would read the Arduino information whenever it receives it.

DEMONSTRATION:

My code is in this zip file

submitted at 12:09 am (please don’t consider this to be late)

 

 

Leave a Reply