# I am trying to make a game with rolling dice

**URL:** <https://forum.kirupa.com/t/i-am-trying-to-make-a-game-with-rolling-dice/316656>\
**Category:** flash\
**Created:** [November 29, 2010, 12:54am UTC](https://forum.kirupa.com/t/i-am-trying-to-make-a-game-with-rolling-dice/316656 "2010-11-29T00:54:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![queenoid](https://avatars.discourse-cdn.com/v4/letter/q/6bbea6/32.png) [@queenoid](https://forum.kirupa.com/u/queenoid)\
**Post date:** [November 29, 2010, 12:54am UTC](https://forum.kirupa.com/t/i-am-trying-to-make-a-game-with-rolling-dice/316656/1 "2010-11-29T00:54:37Z")

</div>

Hi, all.  
I feel like a total dope.  
I am trying to make a game using 5 rolling dice. I have been reading everything I can find and trying to figure this out, but I am stumped and discouraged.  
I know that I need to use either Math.ceil(Math.random()_6) or Math.floor(Math.random() \* 6) to get the value of each die. I made my pictures of the dice, as I knew how to do that!  
It seems to me that I need to tell the code to generate six different numbers, and tell the game to display my dice according to the numbers generated. However, knowing that I need to do that and knowing HOW to do that are totally different things.  
At one point, I thought “well, I’ll just get the dice on the board and then figure out how to call different numbers.” So I wrote this awesome (being sarcastic, here) bit of code:  
for (var i:int = 0; i\<5; i++) {  
var Die = new oneDot();  
addChild(Die);  
Die.x = i_120+115  
Die.y = 175  
I was then the proud owner of five dice that showed one dot and did nothing.  
Can anyone give me a boost? Or point me to a tutorial on how to do this? I have been scouring tutorials, but the ones I have found are too old for me (I’m using Actionscript 3 and Flash CS4) or they just have the complicated bits of code without how to get the dice to show on the board. Like - how the start!  
Can anyone help me? Please?
