Sie sind auf Seite 1von 30

Python OF Fortune!

Wheel of Fortune - Python Style

CST205: Final Project


Brian Begun * Wendy Gray * Christopher Dixon * William Gillihan
Video Presentation: https://youtu.be/c-fiqJvKl3Q
Group Status Google Doc: http://tinyurl.com/q43jvg2

- Press play to start the presentation -


Project Objective
Primary Element: Develop interactive game play.

Secondary Element: Modify and utilize sound with in the


game. Includes: synthesized game sounds, and sound dialog
from movies.

Tertiary Element: Load image and display to player if they


win.
Game Objective
Python OF Fortune: is a game based on the classic television
game show Wheel of Fortune.

The Goal: Solve a puzzle one letter at a time.

The Theme: Famous movie quotes.

You Win! If you can complete the puzzle.

You Lose! If you run out of money before you can complete
the puzzle.
How To Play
Initial Amount: Player starts with $1000

Spin The Wheel: No real wheel here. Instead random dollar


amounts between $100 and $1000 tick up the screen. The
amount that finishes the spin is the value of the players
letter guess.

Guess A Correct Letter: Player is rewarded spin amount for


every instance of the letter.

Guess A Wrong Letter: Player is penalized spin amount for a


wrong guess.
Python Of Fortune vs. Wheel Of Fortune
Command Line Television Show
Random Text Function() With Sound Tones Real Wheel Spinning
Guess A Letter Guess A Letter
Correct Guess = More Money $$$ Correct Guess = More Money $$$
Wrong Guess = You Lose Money $$$ Wrong Guess = You Lose Money $$$
Play Completed Words of Dialog Puzzle Not Available
Run Out Of Money = You Lose! Run Out Of Money = You Lose!
Finish The Puzzle = You Win The Game! Finish The Puzzle = You Win The Game!
Our Approach
Our Approach
Brainstorm
Narrow down ideas
Finalize idea
Breakdown process
Pseudo code the process
List out all necessary assets
Distribute project development to group members
Meet and review work in progress
Integrate parts of code back into project
Debug and debug AGAIN!
Our Approach
Brainstorm: We threw out several ideas that would allow us
to combine the three requirements: Sound or image
manipulation, and a strategy game.

Narrow Down Ideas: Our list quickly reduced to something


using the game show Wheel of Fortune as the base.

Finalize Idea: To include the other two elements, we


combined the concept of the game show with sound
manipulation. Using movie dialog seemed to be the most
straight-forward theme for the game.
Our Approach
Breakdown Process: We detailed how the game would work.
1. Player choice menu
2. Load game sound file.
3. Have one master dialog file to play back the puzzles.
4. Spin the wheel
a. Generate random numbers (in currency formatting).
b. Display random numbers with sound effects to simulate spin.
5. Create in-game sound effects using python sound generation.
6. Ability to play parts of the dialog that the player had completed
(only when words were completed).
7. Reward/penalize player for correct/wrong guesses.
8. Display movie poster if the player completes the puzzle.
9. Display correct guesses in line with dashes to represent yet to be
guessed letters (just like hangman project).
Our Approach
Pseudo Process: Using pseudo code, we described how the
game process would work.

def playSound(phraseState): def spinWheel():


for word in phraseState: ranDollars = random.int()
wordComplete = true x = 0
for letter in word: play(start spin sound)
if letter == _ while x < 10:
wordComplete = false print random.int()
if wordComplete == true x += 1
play section of dialogClip at print \n
normal volume print \n
else play(ding finish spin sound)
play section of dialogClip at 0 print ranDollars #End of spin
volume dollar amount for user
return ranDollars
Our Approach
List out all necessary assets:

Game Sounds
Spinning sound

Final result [Wheelspin]

Wrong answer (Buzz)

Right answer (Ding Ding Ding)

Congrats you won! (Ta DA!)

You lost (DA Da da)


Dialog file (game puzzles)
Movie posters
Our Approach
Distribute Project Development To Group Members:
Wendy: exeGuess() - Execute guess function. Process players guess and act on if right/wrong
guess.

Bill: printPhrase() - Grabs puzzle text, and parses it into single letters and dashes, depending
upon Wendys exeGuess().
spinWheel() - Generate random numbers (currency formatting). Print to screen with spinning wheel
sound each time. Return final result: Value of players guess.
In game sound effects - Build functions to play synthesized game sounds.

Chris: playSound() - Parses out dialog sound file and plays back only words that player completes,
using pre-defined sample indexes.

Brian: pythonOfFortune() and userMenu() - Main functions to execute game and player option menu.
Build game dialog sound file and index words - Cut three movie dialogs together into one file.
Idendify and list start and end sample indexes for every word in all dialog.
Our Approach
Meet And Review Work In Progress: After working separately on our
individual responsibilities, we met as a group, discussed our
progress, and made some tweaks to our workflow when necessary.

Integrate Parts Of Code Back Into Project: As are code parts were
coming together, we would upload them to gitHub into our master game
file.

Debug and Debug AGAIN!: While this may seem pretty obvious, we
would run our game with as many scenarios as we could think of to
see where it may break.
Results - The Home Stretch!
Finalized our concept

Worked out game flow

Conceptualized code (pseudo code)

Divided up the workload to each group member

Re-integrate all members code back into the game.

Debug

Debug Again!
Python of Fortune - Demonstration
Start the game: pythonOfFortune()

Demo
When starting the game, the player
must first select the /assets
folder, which contains the image and
sound assets.

The initial amount to play with is:


$1000
NOTE: Because we are using an old version of python (ver 2.2).
We cannot set relative path ahead of time.
Main menu and player options:

Demo
Type one of the following options:

spin - spin the wheel and guess a letter.


play sound - play the completed part of
the puzzle.
exit - type at anytime to quit the game.
Lets spin the wheel!

Demo
Our version of a wheel spin is to
print random dollar values one at a
time with a click sound in-between
to simulate the wheel hitting marks
(just like the television show!).

We hit $240.
Time to guess a letter:

Demo
Please guess a letter: a

Wow! We got 4 as!


Since our spin resulted in $240, our
reward for choosing correctly is
$240 x 4 = $960.

Our current total is: $1960


Were feeling lucky, after our
next spin, lets pick another
letter...bummer wrong guess this
time:

Demo
The player spins again. This time the
result is: $130

Please guess a letter: f

Your guess was wrong!

Bummer. Because we guessed wrong, $130


was subtracted from our running total of
$1960. Our new total is now: $1830
We completed a word, we can now
play some of the dialog!

Demo
After the player completes at least one
word from the puzzle, he/she can now play
sound to hear that part of the dialog.
As the player completes more words, the
play sound function will play those
parts of the dialog. If they complete the
puzzle, they can hear the entire phrase.
Then YOU WIN!!!!
Wendy: Project Responsibilities
In this project, it was my responsibility to create the
following functionality:
Initialize the game by randomly picking from a database
of quotes and assigning variables accordingly
Evaluate a guessed letter by checking for whether itd
been already guessed, existence in quote and number of
occurrences, and reward or deduct money accordingly.
Check for game win/loss and play appropriate sounds.
Upon win, display an image taken from the quotes movie
with the title and quote displayed on it.
Bill: Project Responsibilities
In this project, it was my responsibility to create the
following functionality:
Write function that loads phrase into a sentence list of
word lists and returns it along with a matching list of
blanks with non alpha characters left intact
Function to grab puzzle text, and parse it into sentence
and/or dash form, used by Wendys execute guess function.
Function to generate random numbers and simulate player
spinning wheel and return amount player is playing for.
Functions for in-game sound effects (e.g. wheelspin,
correct guess, incorrect guess, win, lose)
Chris: Project Responsibilities
In this project, it was my responsibility to create the
following functionality:
I created the playSound() function. My function takes the
phrase in its current state and plays the section of the
audio clip where the word has been completed. It does this
by traversing each letter of each word in the list. If an
underscore exists in place of a letter, the word is not
complete and playSound() will not play that section of the
sound. I also added a list of the start and end sample
indices for the playSound() function to know where to find
the audio for each word.
Brian: Project Responsibilities
In this project, it was my responsibility to create the
following functionality:
Cut all movie dialog together into one file
Index all samples for start & end of each word in dialog
Build pythonOfFortune() introduction function
Build userMenu() function, which calls all other game
functions.
Build and organize power point (google slides)
presentation.
Wendy: What I learned In CST205
The Top Three Things I Learned in this Course:

Good tools to communicate and collaborate are critical


for multi-person coding (i.e. gitHub, Google Docs &
Hangouts, collabedit.com)
Choosing the best IDE is very important to avoid
limitations in coding; JES had some problems that
hindered some project development.
Efficiently planning your code, including psuedocoding,
will greatly decrease the amount of time spent debugging
Bill: What I learned In CST205
The Top Three Things I Learned in this Course:

Pair Programming enables greater creativity, and cleaner


code in Software Development.
Large projects are simplified through following a top-
down process, and use of pseudocode during the design
process.
Debugging is an integral part of any project, and should
be done as frequently as possible
Chris: What I learned In CST205
The Top Three Things I Learned in this Course:

Group projects can quickly become very complicated and


challenging to debug. Good planning and organization are
essential to make the program work correctly.
Other group members can bring a lot of talent to a
project in unexpected ways. I was impressed with the
other members expertise on all of our collaborations.
You can make huge changes on multimedia files with just a
few lines of code. The projects were very fun to work
on.
Brian: What I learned In CST205
The Top Three Things I Learned in this Course:

Developing program workflow (using pseudo code) is an


important step, and can reduce or eliminate code
integration down the road.
Better understanding on how to manipulate sound and image
data using python.
Good collaboration and communication are critical to a
teams ultimate success.
Python OF Fortune!
Wheel of Fortune - Python Style

CST205: Final Project


Brian Begun * Wendy Gray * Christopher Dixon * William Gillihan

Das könnte Ihnen auch gefallen