Overview
I'm thinking of modifying the current shooting control mechanism of the Space Invader game.
The new control will be the status of the squares displayed on the stage and each square is connected to a specific key-down event. For instance, there are 6 squares altogether and correspond to key 1-6 respectively. Some of the squares will randomly change the status to 'activate' (in the form of switching the background color of the squares) and the user needs to press the corresponding keys to shoot.
Object: Alien
Attributes (variables):
- shape
- x position
- y position
- speed
- status
- movement direction
Abilities (functions):
- move down
- move left
- move right
- shooting
- disappear (destroyed)
Collaborators (other objects):
- stage
- score
- bullet
- sound
Object: Laser Cannon
Attributes (variables):
- shape
- x position
- y position
- speed
- status
- times been shooted
- movement direction
Abilities (functions):
- move left
- move right
- shooting
- reset (to the start position)
- disappear (destroyed)
Collaborators (other objects):
- stage
- score
- bullet
- sound
Object: Bullet
Attributes (variables):
- shape
- x position
- y position
- speed
- status
- movement direction
Abilities (functions):
- move down
- move up
- disappear (crashed)
Collaborators (other objects):
- laser cannon
- alien
- stage
Object: Score
Attributes (variables):
- shape
- score board x position
- score board y position
- text x position
- text y position
- counter
- text value
Abilities (functions):
- accumulate score
- decrease score
- clear score
Collaborators (other objects):
- laser cannon
- alien
- stage
Object: Stage
Attributes (variables):
- size
- colour
Abilities (functions):
- display alien movement
- display alien disappear
- display cannon movement
- display cannon disappear
- play sound
- display shooting
- display score
Collaborators (other objects):
- laser cannon
- alien
- audio
- bullet
- twister board
- score
- shooting control
Object: Twister board
Attributes (variables):
- size
- shape
- x position
- y position
- colour
- status
- switching colour frequency
- index of the squares
Abilities (functions):
- switch colour (light up and down)
Collaborators (other objects):
- stage
- shooting
Object: Shooting
Attributes (variables):
- random quantity of the squares that will light up
- random index of the squares that will light up
- key code (corresponding to the key-down event)
Abilities (functions):
- decide which keys control shooting
Collaborators (other objects):
- stage
- twister board
Object: Audio
Attributes (variables):
- status
- name
- URL
Abilities (functions):
- load audio
- play audio
Collaborators (other objects):
- stage
- laser cannon
- alien
没有评论:
发表评论