Community

Programming in probability!

Posted Aug 22, '08 at 1:33pm

PanthaThwaite

PanthaThwaite

3 posts

 -

Hai all.

I was curious as to how hard it is to programme a dice roll into flash.
I have an idea for a turn based game you see, and I want to keep things simple.

Would it be hard to programme in random chances?

Posted Aug 23, '08 at 6:42pm

Darkroot

Darkroot

533 posts

Gold - Lord

Not that hard you can go here for a tutorial.
http://www.flashperfection.com/tutorials/Imitate-a-dice-roll-using-Actionscript-3-classes-in-flash-cs3-24042.html

 

Posted Aug 25, '08 at 9:22am

LonLonRanch

LonLonRanch

151 posts

Gold - Squire

Yes, flash has a few very helpful Math functions that allow you to do a lot of different things with numbers. If you're using AS 2.0 Math.random() takes a random number 0 - whatever you want, in your case it would be:
Math.random() * 6

But if you're using AS 3.0 I'm sure the tutorial above would help

 

Posted Aug 30, '08 at 6:35pm

flappybob999

flappybob999

596 posts

Wood - Prince

Click here

That should make your link a little easier, Darkroot. :)

 
Reply to Programming in probability!

You must be logged in to post a reply!