Title: CS103 HW 23
1CS103 HW 2/3
- Group 16
- Leader Matthew Scott
- Members Steven White, William Ma, Sue Ellen
Wong, Linh Tran
2The Basics
Click on these stop buttons to stop the slot
machine
History of wins/loss with the players current
earnings on top
Displays combo
Select amount to play
Winning combos to calculate the winnings
3The Layers
the machine layer
slots layer
info layer
buttons layer
combos layer
4The Machine and Combos Layer
The machine and combos layer are basically
drawings made by the rectangle tool and pictures
machine layer
combos layer
5Info Layer
The info layer consists of 2 movies within a
movie.
account_info
The first movie is account_info. This holds the
account history information.
The second movie is check. This basically imports
the image used in the checkbox (i.e. the
aitself). Each box has a mouse event (example
2) on (release) _root.info.check._y
21.7 _root.wager 2 Positions the check
mark to box. Sets wager amount to appropriate
value (in this case 2).
check
6Buttons Layer
When the is pressed, a random frame
(stored in slot function) is chosen to start each
slot spinning. This was used to randomize the
start object that appears in each slot.
On the second frame, the appear and the
code is simply to stop()
7The Buttons Layer
on (release) if (_root.slot1._currentframe lt
20) _root.slot1.gotoAndStop(random(5)20)
(Code from slot 1) Stop button control which
randomly selects a frame to display as the final
slot.
8The Slots Layer
From the random slot selected, the image in each
slot changes accordingly using motion tweening.
Notice images are blurred
Final images contrasted
9The Code
Check for winning combinations and calculates
accordingly and the value is stored in account
variable. For example If all apples were
spun _root.account 100 _root.wager
_root.wager (essentially, 100 times the wager
plus the wager back)
10The Code
Initially, a temp value is set to blank to clear
the accountString variable. Concat() function
used to append the symbol to the new account
value stored as accountString.
This decrements the wage from the account. So if
you dont win, then by your account decreases by
the wage. When you win, the wage is added back to
your account.
11The Code
accountHistory.unshift( _root.accountString
) if (accountHistory.length gt7)
accountHistory.pop() accountHistoryString
accountHistory1 newline accountHistory2
newline accountHistory3 newline
accountHistory4 newline accountHistory5
This uses the unshift() function to add the
newest accountString value to the accountHistory.
Prints the last 5 entries by storing the values
into accountHistoryString.
12Questions?