Scratch L.v 3
https://scratch.mit.edu/projects/189040775/
Questions: 1) I had some difficulty when programming the second player. This was because when I was coding the player 2, the Ai paddle stopped working for some reason. The problem was that when I pressed space to start, the Ai paddle would be confused and not know what to do because I had "press space" to start the game, and add in the Ai. This caused the paddle to "malfunction" and not work as intended as it stood still while the rest of the code worked. I fixed this by adding a second paddle with the command to hide whenever the green flag was pressed, but when the left arrow was pressed, would appear and would be controlled by the arrow keys. I also added a "hide" block to the Ai paddle whenever the left arrow was pressed so that player 2 wouldn't have an advantage of a computer player.
2) I added a player 2 mechanic and a faster ball speed whenever the paddle hit the ball, which was kind of mimicking the game Lethal League. I added a P2 mechanic because I felt that it would be nice to play with friends when you could, and see who was the best at playing Pong. I explained it in the previous paragraph how I added the P2. I added in the increasing speed because I felt like the the game would be too boring and uninteresting if the ball went too slow. I did this by making a variable and making the ball move the variable's steps. I also made it so that the ball would increase the speed by 1 every time it hit a paddle.
Great work by having the option of playing as one player or two players. Well done.
ReplyDelete-30/30
- Mr Chen