On the right: a panel with two buttons: 'start' and 'stop'
On the left: the game field, which contains:
On top: score table
Underneath: sport field, with supporters' stands on top and bottom of it
In the field: there are two players, represented by rectangles, and a ball
Functionality:
The ball moves on the field with a constant speed, and bounces off the left and right borders (in the X direction)
The ball bounces off the rectangular players (in the Y direction)
The players can move in both the X and Y direction (each
player has got a separate set of keys on the keyboard)
When the ball crosses the top or bottom borders, the bottom or top player, respectively, gains a point, and the scoretable is updated
After the player gains a point, he can serve the next ball (with the key on the keyboard)
Crowd animation: On the top and bottom of the field are the supporters' stands
represented by a simple animation. The crowd is drawn with random pixels (ca. 25000 pixels are randomly chosen in each drawing: random placement and random color),
and is being refreshed each time the next frame of animation
is evaluated.
The 'start' button resets the score, enables the players to serve the ball, and starts the crowd animation; the 'stop' button stops the animation and disables ball serving
Options (should be contained in the menu and accessed with the appropriate common dialogs)
Changing the score display fonts
Changing the players' colors; each of the players have two colors:
for shirt and for trousers - the rectangles on the field should be drawn with the gradient brush
Use the 'About' dialog or the right panel in the main window
to describe the movement keys
Technical requirements:
Catch all exceptions
Prevent bitmap flickering
Use separate thread(s) for drawing the supporters' stands
Make sure the drawing thread is not running when the program ends
The window resizing can be disabled (in order to prevent exceptional drawing issues during the game), however, after resizing in the form editor, all the controls should move automatically to the correct places
[!] Errors are allowed in the game functionality, e. g. in ball/players and ball/field borders collisions,
the 'start' and 'stop' buttons, etc. - these are not the primary aim of the program, so make
them as simple as possible (see the 'Approximate points'
section).
Hints:
Timer control
FontDialog, ColorDialog controls
System.Threading
ControlStyles.DoubleBuffer ([!] set it in the
constructor, not in the Load message handler in the main form)
Approximate points:
form layout: 2.0
color and font dialogs: 2.0
game control (ball movement, moving the players): 2.5
threading (animated crowd): 2.5
ball bouncing and point scoring, 'start' and 'stop' buttons: 1.0