Brick
From Ece
Contents |
Team Demolition
The objective of this project is to recreate the popular game called Brick.
Team Members
Jason Aycock - Checker
Tina McGlaston - Recorder
Alan Pritchard - Coordinator
Phase 1
Introduction
Brick is a popular game that is found on many of the newer cell phones. The objective of the game is to clear all of the bricks without losing all of the player’s lives. The player’s score will increment on the seven segment display each time a brick is hit. The bricks are square and will be colored differently to be able to tell where each brick begins and ends. The paddle is placed at the bottom of the screen, and there is a wall that appears on all sides of the screen except for the bottom, which is where the paddle is. If the ball goes off the screen, a life is lost.
Concept
By the projects end, the VGA monitor will display the famous brick game. The Basys board will be used to display the lives that a player has left along with their current score. It will control all aspects of the game. The ps/2 keyboard will control the user's input, movement of the paddle.
Proposed Work
1. ps2core module – takes in the raw data from the ps/2 keyboard and converts it into an opcode.
2. ps2decode module – takes the value from the ps2core module and decodes it into a form that can be used by the other various modules.
3. ball_control module – this module is used to control the movement of the ball and how it interacts with the current game environment.
4. paddle_control module – controls the paddles movement
5. draw_vga module – displays the current game state
6. vga_sync module – controls vertical and horizontal synchronization
7. brick_control module – controls whether or not a brick has been hit
8. score module – keeps track of the score of the game and increments the score each time a brick is hit
9. binarytobcd module – converts a binary number into a binary coded decimal
10. segdecode module – this module is used to convert the binary number to display on the seven segment display
11. lives_left module – this module will used LEDs to display the amount of lives left, and the number will decrement each time a life is lost
Required Parts
- PS/2 keyboard
- VGA Monitor
- Basys Spartan 3E Development Board
Expected Deliverables
When the project is completed, the game board will be displayed on the screen. The ball will begin moving, and the player will be able to move the paddle left or right using the arrow keys on the keyboard. At the start of a round, the ball will move downward and make a 45 degree turn if it hits the paddle. When the ball hits the paddle any other time, it should turn at a 90 degree angle. Otherwise, the game will decrement a life and reset the board. If the ball hits a brick, the brick should disappear, and the ball should make a 90 degree turn. When all bricks are cleared, the game is over.
Phase 2
Introduction
Brick is a popular game that is found on many of the newer cell phones. The objective of the game is to clear all of the bricks without losing all of the player’s lives. The player’s score will increment on the seven segment display each time a brick is hit. The bricks are square and will be colored differently to be able to tell where each brick begins and ends. The paddle is placed at the bottom of the screen, and there is a wall that appears on all sides of the screen except for the bottom, which is where the paddle is. If the ball goes off the screen, a life is lost.
Concept
By the projects end, the VGA monitor will display the famous brick game. The Basys board will be used to display the lives that a player has left along with their current score. It will control all aspects of the game. The ps/2 keyboard will control the user's input, movement of the paddle.
Proposed Work
1. ps2core module – takes in the raw data from the ps/2 keyboard and converts it into an opcode.
2. ps2decode module – takes the value from the ps2core module and decodes it into a form that can be used by the other various modules.
3. ball_control module – this module is used to control the movement of the ball and how it interacts with the current game environment.
4. paddle_control module – controls the paddles movement
5. draw_vga module – displays the current game state
6. vga_sync module – controls vertical and horizontal synchronization
7. brick_control module – controls whether or not a brick has been hit
8. score module – keeps track of the score of the game and increments the score each time a brick is hit
9. binarytobcd module – converts a binary number into a binary coded decimal
10. segdecode module – this module is used to convert the binary number to display on the seven segment display
11. lives_left module – this module will used LEDs to display the amount of lives left, and the number will decrement each time a life is lost
Required Parts
- PS/2 keyboard
- VGA Monitor
- Basys Spartan 3E Development Board
Expected Deliverables
When the project is completed, the game board will be displayed on the screen. The ball will begin moving, and the player will be able to move the paddle left or right using the arrow keys on the keyboard. At the start of a round, the ball will move downward and make a 45 degree turn if it hits the paddle. When the ball hits the paddle any other time, it should turn at a 90 degree angle. Otherwise, the game will decrement a life and reset the board. If the ball hits a brick, the brick should disappear, and the ball should make a 90 degree turn. When all bricks are cleared, the game is over.
Block Diagram
Phase 3
Review of Proposed Work
1. ps2core module – takes in the raw data from the ps/2 keyboard and converts it into an opcode.
2. ps2decode module – takes the value from the ps2core module and decodes it into a form that can be used by the other various modules.
3. ball_control module – this module is used to control the movement of the ball and how it interacts with the current game environment.
4. paddle_control module – controls the paddles movement
5. draw_vga module – displays the current game state
6. vga_sync module – controls vertical and horizontal synchronization
7. brick_control module – controls whether or not a brick has been hit
8. score module – keeps track of the score of the game and increments the score each time a brick is hit
9. binarytobcd module – converts a binary number into a binary coded decimal
10. segdecode module – this module is used to convert the binary number to display on the seven segment display
11. lives_left module – this module will used LEDs to display the amount of lives left, and the number will decrement each time a life is lost
Modules
1. ps2core
- Input: ps2data – data that comes from the keyboard
- Input: ps2clock – clock from the keyboard
- Output: hexcode[15:0] – converted hexcode from the keyboard
- Output: badparity
- Output: ready
- Description – will output the raw code received from the keyboard
2. ps2_decode
- Input: ps2_raw[15:0] – this is the keyboard code
- Output: live_left[7:0] – this is used to output the lives left
- Output: opcode[2:0] – movement code for the keyboard
- Description – converts the ps2data into a similar opcode
3. ball_control
- Input: clk
- Input: paddleY[9:0] – gets the position of the Paddle
- Input: ps2_raw[15:0] – takes in opcodes to detect a reset
- Input: brickX[9:0] - takes in the location of the brick so collisions can be detected
- Input: brickY[9:0] – takes in the location of the brick so collisions can be detected
- Output: ballX[9:0] – outputs the position of the ball X coordinates
- Output: ballY[9:0] – output the position of the ball Y coordinates
- Description – is used to give the location of the ball and to make the movements and detect collisions
4. paddle_control
- Input: clk
- Input: opcode[2:0] – takes in the opcode from the keyboard
- Output: paddleY[9:0] – this will make the movements of the paddle on the screen
- Description – is used to control the paddle movements
5. draw_vga
- Input: clk – 50Mhz clock
- Input: video_on – asserted high when the row/col are valid
- Input: paddleY – paddles Y coordinate
- Input: brickX[9:0] – bricks X coordinate
- Input: brickY[9:0] – bricks Y coordinate
- Input: ballX[9:0] – balls X coordinate
- Input: ballY[9:0] – balls Y coordinate
- Input: row[9:0] – currently drawn pixels Y coordinate
- Input: col[9:0] – currently drawn pixels X coordinate
- Output: red – red signal to VGA port
- Output: green – green signal to VGA port
- Output: blue – blue signal to VGA port
- Description – determines the RGB values for the color of the pixel being drawn
6. vga_sync
- Input: clk – 50Mhz clock
- Output: h_sync – horizontal sync for VGA port
- Output: v_sync – vertical sync for the VGA port
- Output: video_on – high when row/col are valid
- Output: pixel_row[9:0] – value of the currently drawn Y coordinate
- Output: pixel_col[9:0] – value of the currently drawn X coordinate
- Description – it will compute the pixel coordinates that are currently drawn and manages the vertical and horizontal signals to the VGA output.
7. brick_control
- Input: brick_hit – if asserted high the brick has been hit
- Input: ballX – gives the positioning of the ball’s X coordinates
- Input: ballY – gives the positioning of the ball’s Y coordinates
- Output: brickX – positioning of the brick’s X coordinates
- Output: brickY – positioning of the brick’s Y coordinates
- Description – used to give the X and Y coordinates of the created brick
8. score_module
- Input: clk – 50Mhz clock
- Input: brick_destroyed – used to erase a destroyed brick
- Output: score[13:0] – output’s the users current score
- Description – increments the users score whenever a brick is destroyed.
9. binary2bcd
- Input: score[13:0]- user’s current score
- Output: display[15:0]
- Description – converts the binary score to bcd for the segdecode module
10. segdecode
- Input clk – 50Mhz clock
- Input char3[3:0] – fourth seven-segment display
- Input char2[3:0] – third seven-segment display
- Input char1[3:0] – second seven-segment display
- Input char[3:0] – first seven-segment display
- Output: anode[3:0] – outputs to seven-segment display
- Output: sevenseg[7:0] – outputs the values to each of the different segments
- Description – display’s the users score to the seven-segment display
11. lives_left
- Input: clk – 50Mhz clock
- Input: ballX[9:0] – gets ball’s X coordinates
- Input: ballY[9:0] – gets ball’s Y coordinates
- Output: lives_left[2:0] – outputs the users lives to the led-array
- Description: it will decrement the lives left if the ball leaves the screen
Phase 4
Analysis of Proposed Work
After completion of the project the following modules were not complete: lives_left module: it was used to inform the user the amount of lives they had left through the LEDs.
Instead of creating the lives lost module, we included the information in the score module instead.
Functionality added:
- Instead of our game displaying an abundance of bricks on the screen, like the traditional game of Brick, we decided to only have it display three bricks at a time. Each time that a brick is hit, a new brick is displayed in a random location. This was done to increase the difficulty of the game, because a player would not know where the next brick would be displayed.
- Decrementing the paddle length each time a brick was hit is another feature that was added to increase the difficulty of the game. The paddle will only decrement down to the size of the ball.
Top-Level Block Diagram
Project Files
[[1]]





