top of page
Search
  • Writer's pictureNicole Nitz

Final Project Complete

So for my final project I made a one player shoot and score hockey game. As far as the code went I started with the catch and release code we did in class as a base and took some parts out and added others. There is a black rectangular goal that moves back and forth across the top of the screen and a puck that also glides over the screen/ice. You have to grab the puck and throw it towards the goal and score as many points as you can before the time is up. Inside the goal there are three points that when the ball comes in contact with them, it brings the score up by 1 point. One issue I was trying to fix was that when you throw the ball too hard you can't really catch it. I was able to get the ball to slow down a bit, however it was getting stuck to the sides and glitching. I added a keyPressed function so that if the ball starts glitching or can't be caught you can press the space bar and it will bring the puck back to center ice. The puck will also return to center ice when you score a point so that the ball can't just linger on top of the goal and rack up points. I was also having trouble getting the score to work correctly. At first the score was only detected when you held the puck over the left side of the goal. I realized that the part of my code that called for the puck to be detected in the goal area was below the part that allows for you to grab the puck. I ended up moving the goal/puck part above the mouse/puck part and it worked.

Since we couldn't really connect the microbit, what I did was have the microbit count down from 10-0 and when it reaches 0 the red LED light will blink letting you know your time is up and to record your score. I liked doing this because if you did want to play with multiple people everyone could write down their own score to see who wins. Overall I really enojyed making this project. Although I had some help from Professor Hagan and my boyfriend there were a lot of parts I was able to figure out on my own which was really cool, and I was definitely proud of myself because I'm not very computer savy.

Below are pictures of the code and the game itself. Looking at the pictures of the code I would like to clean it up a bit and take out the parts that I ended up voiding out. (the parts that start with "//")






3 views0 comments

Recent Posts

See All

Final Project Idea

For my final project I want to make an air hockey type of game but have it be single player. I want there to be a puck/ball and goal posts that you have to hit the ball into with a shape that’s attach

bottom of page