ele409 final project: simon saysgame logic 1. stores player’s input sequence as a list 2. send...

11
ELE409 Final Project: Simon Says Taylor Coogan Jordan Volpe 1

Upload: others

Post on 25-Dec-2019

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ELE409 Final Project: Simon SaysGame Logic 1. Stores player’s input sequence as a list 2. Send list to opponent 3. Sequence flashes on opponents screen 4. Opponent response sequence

ELE409 Final Project: Simon Says

Taylor Coogan Jordan Volpe

1

Page 2: ELE409 Final Project: Simon SaysGame Logic 1. Stores player’s input sequence as a list 2. Send list to opponent 3. Sequence flashes on opponents screen 4. Opponent response sequence

Project Overview

•  Based on “Simon Says” game

•  Multiplayer game using sockets •  Board-to-Board Communication

•  Touch Screen input for gameplay

•  Tracks sequence length and player “lives”

2

Page 3: ELE409 Final Project: Simon SaysGame Logic 1. Stores player’s input sequence as a list 2. Send list to opponent 3. Sequence flashes on opponents screen 4. Opponent response sequence

High Level Block Diagram

3

Page 4: ELE409 Final Project: Simon SaysGame Logic 1. Stores player’s input sequence as a list 2. Send list to opponent 3. Sequence flashes on opponents screen 4. Opponent response sequence

Gameplay Specifics •  Players take turns pressing a sequence

of colors on their touch screen

•  Other player must accurately repeat the sequence

•  Sequence length +=1 each round •  Sequence is cumulative for each round

•  If a player enters incorrect sequence, they lose a “life”

•  Once one player loses 3 lives, the game ends 4

Page 5: ELE409 Final Project: Simon SaysGame Logic 1. Stores player’s input sequence as a list 2. Send list to opponent 3. Sequence flashes on opponents screen 4. Opponent response sequence

Touch Screen I/O •  Screen divided into quadrants

•  Touch/click coordinate data determines which color button was pushed

•  When button (quadrant) is pushed, or when a sequence is repeated on a screen, the corresponding quadrant will flash

•  Quickly change color of quadrant

Responsibility of Taylor

5

Page 6: ELE409 Final Project: Simon SaysGame Logic 1. Stores player’s input sequence as a list 2. Send list to opponent 3. Sequence flashes on opponents screen 4. Opponent response sequence

Game Logic 1.  Stores player’s input sequence as a list

2.  Send list to opponent

3.  Sequence flashes on opponents screen

4.  Opponent response sequence is saved to a list

5.  Compare the sent sequence list with the response sequence list

6.  If they do not match, player failed

7.  Otherwise game continues

8.  If sequence length > 1, check if sequence matches previous sequence by temporarily removing last element of new sequence and comparing it to the old one

9.  If round/game ends, call appropriate C functions to change LEDs/Sevenseg and display appropriate text to screen

Responsibility of Taylor 6

Page 7: ELE409 Final Project: Simon SaysGame Logic 1. Stores player’s input sequence as a list 2. Send list to opponent 3. Sequence flashes on opponents screen 4. Opponent response sequence

Networking (Multiplayer) •  Uses python TCP socket to communicate

•  Board sends sequence list through socket using client function

•  Then board listens for response using server function

•  Convert sequence list to byte stream to send through socket

•  Unpack byte stream on other end

Responsibility of Jordan

DE1-SOC DE1-SOC

7

Page 8: ELE409 Final Project: Simon SaysGame Logic 1. Stores player’s input sequence as a list 2. Send list to opponent 3. Sequence flashes on opponents screen 4. Opponent response sequence

Seven Segment Displays & LEDs •  The current round/sequence length is

displayed on each board

•  Each player’s number of “lives” corresponds with the number of LEDs lit

•  Used shift left to display both players lives on each board

•  Called C Program executables from the python script

Responsibility of Jordan

8

Page 9: ELE409 Final Project: Simon SaysGame Logic 1. Stores player’s input sequence as a list 2. Send list to opponent 3. Sequence flashes on opponents screen 4. Opponent response sequence

Speaker (Audio) •  Tried to configure audio for game

•  Distinct “beep” tone would play when a button/quadrant is pushed by a player

•  Successfully configured this for a desktop computer (or a device with audio driver)

•  DE1_SoC did not have audio drivers, so our efforts were unsuccessful

9

Page 10: ELE409 Final Project: Simon SaysGame Logic 1. Stores player’s input sequence as a list 2. Send list to opponent 3. Sequence flashes on opponents screen 4. Opponent response sequence

https://youtu.be/yvL1R0qDTJ0

10

Demo

Page 11: ELE409 Final Project: Simon SaysGame Logic 1. Stores player’s input sequence as a list 2. Send list to opponent 3. Sequence flashes on opponents screen 4. Opponent response sequence

Thank You! Questions

Taylor Coogan Jordan Volpe

11