In a previous assignment, you showed a couple of graphics, where each can be moved by the arrow keys, or w/a/s/d. The idea is that two people could share a keyboard and play against each other. We will call the character controlled by the arrow keys as "player1" and the character controlled by w/a/s/d "player2".

This assignment builds on that. You should keep copies of your previous solutions and call each solution by a different name. For example, you can use the homework number as part of the filename.

In this assignment, add collision detection. Each character should be its own sprite, and for this assignment, use the 32x32 graphics red_square.png and blue_square.png. These are also available under the professor's public_html directory on GAMEDEV.

Start with a white background. See background.html for an example of changing the background color. We will also make use of a red and a green background. Feel free to change the colors as you see fit, as long as the colors are recognizable as green and red.

Each time a key press is detected, check to see if the sprites are colliding. If the sprite controlled by one of the players collides with the other, change the background to red. If the sprite are not colliding, change the background to green. Test this to make sure that it works.

Turn in a link to your page on iCollege.