3 Dice checking trouble......Array? List? Linq?
HI guys....I'm really lost trying to find a answer for this....
I'm trying to do a dice throwing game (Ceelo \ strunk flower game). I already made the script for identify wich side is up and already made the die prefab. Now it goes..... I have to throw 3 dices, so as my enemy. Both of us have 4 turns. If one of us hit some certain numbers, we win, lose or its a draw (some rules for example: if i hit a 6-6-1 and the other a 2-2-6, he wins. If I hit a triple 5 and the other a triple 4, he loses. If i hit a 1-2-3 I lose. All these examples it doesnt matter the order of the dices)
I'm already trying to learn about the turn based scheme but about the results....I must have 3 arrays? lists? I know i have to compare the player throws vs the enemy throws with the rules. Shit is giving me bluescreen in my brain. Some guy told me about linq, but i didnt understood that.
I really appreciate if you guys can help me...... I don't know if this is gonna help, but here it is my diceCheck script:
public class DiceNumberUp : MonoBehaviour {
int CalcSideUp()
{
float dotFwd = Vector3.Dot(transform.forward, Vector3.up);
if (dotFwd > 0.99f) return 4;
if (dotFwd < -0.99f) return 3;
float dotRight = Vector3.Dot(transform.right, Vector3.up);
if (dotRight > 0.99f) return 2;
if (dotRight < -0.99f) return 5;
float dotUp = Vector3.Dot(transform.up, Vector3.up);
if (dotUp > 0.99f) return 6;
if (dotUp < -0.99f) return 1;
return 0;
}
void Start()
{
int side = CalcSideUp();
if (side > 0) Debug.Log("Side = " + side);
}
}