Like I stated in last weeks blog post I moved the AI to this week so I spent Monday and Tuesday on that and then during Wednesday and Thursday I implemented the powerup/down and today I have made the gameover work when the time is up. For more info on the AI read the post “Dumb AI“.
For the powerup(s) I though that I had only planned on making a ‘faster ball’ powerup but when I checked the project plan I saw that I should instead make two variants, one to make the paddle wider and on to make it smaller. So the way this works is that a powerup will spawn in a random position on the playing field. If it is the wide-paddle one the player who ‘directs’ the ball to it will receive the award and if it is a small-paddle the next player to deflect the ball will receive it. When a powerup has been taken another one will spawn in the next 10-20 seconds.
I also change the walls of the playing field to be angled since I noticed that the ball would often get stuck bouncing between two walls.
And finally today I added a game clock to the server which starts when the first player joins and counts down from 5 minutes. When the time has run out a gameover message is sent to all clients and they all disconnect and the game gets deleted from the server. When a client receives the gameover message a sorted scoreboard is displayed with an option to return to the main menu.
The following video shows the angled walls, the new ai and the powerups