CS103 HW 23 - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

CS103 HW 23

Description:

Sets wager amount to appropriate value (in this case 2). Buttons Layer ... (essentially, 100 times the wager plus the wager back) The Code ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 13
Provided by: sushi9
Category:
Tags: cs103 | wager

less

Transcript and Presenter's Notes

Title: CS103 HW 23


1
CS103 HW 2/3
  • Group 16
  • Leader Matthew Scott
  • Members Steven White, William Ma, Sue Ellen
    Wong, Linh Tran

2
The 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
3
The Layers
the machine layer
slots layer
info layer
buttons layer
combos layer
4
The Machine and Combos Layer
The machine and combos layer are basically
drawings made by the rectangle tool and pictures
machine layer
combos layer
5
Info 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
6
Buttons 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()
7
The 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.
8
The Slots Layer
From the random slot selected, the image in each
slot changes accordingly using motion tweening.
Notice images are blurred
Final images contrasted
9
The 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)
10
The 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.
11
The 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.
12
Questions?
Write a Comment
User Comments (0)
About PowerShow.com