COMP1000 When the character collides with an obstacle, i.e. any part of the character’s body meets the obstacle, there must be some visual indication that the game is over.

Introduction

In assignment 1 you will be programming a basic game that features a playable character of your choice and some simple mechanics such as movement and collision detection. Please read this specification thoroughly. Please also refer to the provided marking rubric for the weighting of each feature. For full marks you need to implement all the following features correctly. You should submit just one program with as many of the features as you can get done

Specifications

Canvas

The canvas should be a square that is 700 pixels in width and 700 pixels in height.

Character Design

You will need to come up with a design for your playable character. For full marks your character must be a complex shape drawn using at least 3 simple shapes. You must also use at least 2 different types of simple shapes. For example, a character that is drawn using 2 rectangles and a line OR a character drawn using two triangles and a circle would both suffice. The character’s overall dimensions should be approx. 70 pixels in width and 70 pixels in height. The character should appear randomly on the screen starting from the very left. The entire character must appear on the screen when the game begins.

Home Design

You will need to come up with a design for your character’s home. For full marks your character’s home must be a complex shape drawn using at least 3 simple shapes. You must also use at least 2 different types of simple shapes. For example, a character’s home that is drawn using 2 rectangles and a line OR a character’s home drawn using two triangles and a circle would both suffice. The character’s home’s overall dimensions should be approx. 70 pixels in width and 70 pixels in height. The character’s home must be in level with the character on the very right and the home doesn’t move. Obstacle Design You will need an obstacle like a wall present on the canvas. The position of the obstacle should be randomly generated on the right half side of the canvas but must not overlap the home. This means that each time the program is run the obstacle will appear in different positions, but on the right half side. You are free to design the obstacles however you like, but the only requirement is they have to be rectangular.

Movement

  1. The character moves automatically from left to right. The speed must be about 5-8 seconds for the character to reach home
  2. The character’s home doesn’t move. Since the home and the character are aligned, if there are no obstacles, the character must reach home automatically.
  3. The obstacles will be controlled using the arrow keys in the following manner:
  • The UP arrow key moves the obstacle up by 70 pixels.
  • The DOWN arrow key moves the obstacle down 70 pixels.

Collision

  1. The character must be prevented from moving off the canvas.
  2. When the character reaches the home, i.e. the entire body of the character is inside the home, there must be some visual indication that the game is won. An example of this could be the canvas is cleared and the text “game won” is displayed. You are free to design your own game won screen.
  3. When the character collides with an obstacle, i.e. any part of the character’s body meets the obstacle, there must be some visual indication that the game is over. An example of this could be the canvas is cleared and the text “game over” is displayed. You are free to design your own game over screen.
  4. The “game won” and “game over” screen should persist and not disappear automatically