Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-03-2008, 06:57 AM   #1
tommygruber
Registered User
 
Join Date: Sep 2008
Posts: 3
Default [AS2] Dice game help

Hello,

I'm programming this dice game that's similar to yahtzee. It has 6 dice and I'm trying to figure out how to assign Points to the dice and certain rolls.

for example, if the 6 dice show 1,2,3,4,5,6; Then that would be a certain amount of points.

Any feedback on this would be awesome.

Thank you,

Tommy

www.gmediaservices.com
tommygruber is offline   Reply With Quote
Old 09-03-2008, 09:18 AM   #2
drumn4life0789
Registered User
 
Join Date: Feb 2007
Posts: 160
Default

first you need to know how they will roll. Like are they really rolling and whatever is facking up is what is called or is it like click this button and watch these 6 numbers change then they stop.

But eaither way you would have to create an array wich will check and add up the data and so on.
drumn4life0789 is offline   Reply With Quote
Old 09-03-2008, 01:19 PM   #3
syruplord
Registered User
 
Join Date: Jul 2008
Posts: 32
Default

if all else fails, if(a and b and c...){points = x;}
syruplord is offline   Reply With Quote
Old 09-03-2008, 06:26 PM   #4
tommygruber
Registered User
 
Join Date: Sep 2008
Posts: 3
Default Dice Help!

Hey,

Thank you for the advice. The only problem is my game doesn't add up the dice, the points are based off of what numbers show up.

1's are worth 100
5's are worth 50
3 of a kind = face value ( 3 Five's is 500 points)
4 of a kind = face value (4 two's is 2000 points)

I have a dice roller button and when you click on it it calls my rollDice function. I have my 6 dice in an Array called aDice. I'm also tracing the array to make sure the same numbers that are on the dice table are the same in the output panel.

So I guess my question is how to let flash know that when certain combinations of numbers appear, They have a set value.

Thank you again for your input,
tommygruber is offline   Reply With Quote
Old 09-03-2008, 08:26 PM   #5
rrh
throw a trace() in there
 
Join Date: Dec 2006
Posts: 1,982
Default

Oh man. That's "You Blew It!" I was totally playing with this a couple weeks ago.

it went something like this:
ActionScript Code:
plug all the values into diceArray sort diceArray  if diceArray matches 12345 or 23456 {   score is 1000 } else {  countArray=[0,0,0,0,0,0,0]  for each entry in diceArray,          increment the corresponding entry in countArray  if any entry in countArray is 3 or more, then {    three of a kind  } else {    score is countArray[1]*100+countArray[5]*50  } }
rrh is offline   Reply With Quote
Old 09-03-2008, 09:51 PM   #6
tommygruber
Registered User
 
Join Date: Sep 2008
Posts: 3
Default

Wow! Thankyou...
tommygruber is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[AS2] flash game and audio un sync ultraman Gaming and Game Development 0 08-05-2008 06:35 PM
FlashGameLicense.com - virtual marketplace to connect game developers and buyers AdamSchroeder General Chat 0 12-18-2007 09:16 PM
[AS2] Dice Game metal chao Gaming and Game Development 4 11-22-2006 06:20 PM
[AS2] Tile game or not tile game? krolben Gaming and Game Development 4 07-28-2004 12:41 PM
[AS2] Locating bug in game MiniMurderdoll Gaming and Game Development 0 06-01-2004 10:27 AM


All times are GMT. The time now is 04:25 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.