ForumsProgramming ForumProgramming in probability!

5 4116
PanthaThwaite
offline
PanthaThwaite
3 posts
Nomad

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?

  • 5 Replies
Darkroot
offline
Darkroot
2,763 posts
Peasant

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

LonLonRanch
offline
LonLonRanch
172 posts
Nomad

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

flappybob999
offline
flappybob999
797 posts
Peasant

Click here

That should make your link a little easier, Darkroot.

Darkroot
offline
Darkroot
2,763 posts
Peasant

Why did this get resurrected? I didn't bring it back up.

This is pretty ancient, you could see how much of a noob I was before. *Tries to cover it up*.

I noticed a lot of old topic are getting resurrected for like no reason.

PixelSmash
offline
PixelSmash
566 posts
Nomad

Yeah, that's kinda weird. Maybe the forums are a bit glitchy? I see your post as the only one not from '08 XD

Showing 1-5 of 5