This is a discussion on "Dice roller!" within the JavaScript Forum section. This forum, and the thread "Dice roller! are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Dice roller!
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Dice roller!
Hey, im about a create a dice-roller game but don't know how to move on. The game needs to contain vars, functions, if statements, arrays and for loops. I've got 6 images in a .gif format.
The goals I want to archive: - Got 3 dices, each shall be thrown individually. - There shall be a button to throw all dices. - When the "Throw all"-button is pressed a result shall be shown. - You only get points when you get 2 or 3 dices of same kind, else the score is 0. If you get 3 dices of same kind you get the points * 2. (Could be done with a if-statement). - An Array shall be used to save the scores from the rounds when you get points. - To display the total score you make another button with an Alert function containing all the results in a text-string and the sum of all results togheter. Thats about all... I've started but, as I said, I dont know how to move on. At the moment the result of all dices are written and i cant thrown them individually. Hope someone can help me, Cheers!
|
|
|
|
|||
|
Re: Dice roller!
You should use arrays with randomizing functions.
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
|
|
|||
|
Re: Dice roller!
Can you show me how to do that, im still learning and need some guidance.
|
|
|||
|
Re: Dice roller!
On clicking the throw dice,
1. One function must be called to throw dice one. This same function will define the value of variable assigned to the score for dice 1. 2. One function as dice 2. 3. One function for dice 3. 4. One function to up three scores 5. One IF ELSE statement to double the score if all are same.
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Rim roller | Ecthelion | Free Web Site Critique | 22 | Mar 15th, 2007 07:53 |
| Roller/brushstroke effects in Fireworks | minute44 | Graphics and 3D | 4 | Sep 5th, 2006 18:12 |