How do I work a three of a kind (Dice game)?

0 favourites
From the Asset Store
a basic game template with which you can show your own creativity with interactive and exciting rolling of ion dice!
  • Also I came up with a way to make this game using an array but you already started making it. You could roll 6 dice which are 6 rows of an array, an array helps you to count the number of each type or determine if you rolled something by using 'array contains value'. Also you can sort an array so you could put any dice rolls in numerical order to find the straight.

    How many families and arrays would I used

    if I get a

    sm straight of 1, 2, 3, 4, and 5 AND of 2, 3, 4, 5, and 6

    , and a

    Lg Straight of 1, 2, 3, 4, 5, and 6?

  • There's no point doing the array method if you've already started this way. As I mentioned you can use a family to group all the dice into one condition 'for each dice(family)' checks all of the objects.

  • There's no point doing the array method if you've already started this way. As I mentioned you can use a family to group all the dice into one condition 'for each dice(family)' checks all of the objects.

    Thanks

  • > There's no point doing the array method if you've already started this way. As I mentioned you can use a family to group all the dice into one condition 'for each dice(family)' checks all of the objects.

    Thanks

    One more thing, how can I add the family to the code without interfering with the other dice. Do you need my code to see where I could put it?

  • Family can be used independently of other events. You use it where you want to pick all of the dice together to find their values. You may have to bring the dice value variable up to the family level though, something called a family instance variable, and go from there.

  • Family can be used independently of other events. You use it where you want to pick all of the dice together to find their values. You may have to bring the dice value variable up to the family level though, something called a family instance variable, and go from there.

    Like this?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • > Family can be used independently of other events. You use it where you want to pick all of the dice together to find their values. You may have to bring the dice value variable up to the family level though, something called a family instance variable, and go from there.

    Like this?

    What else do I add to let it take effect

  • I'm saying the variable for faceval should become a family instance variable then it's easier. As for the logic to check for the straight I mentioned it above but you'll have to work it out. You need to check that any dice is a 1 then a 2 then a 3 etc

  • I'm saying the variable for faceval should become a family instance variable then it's easier. As for the logic to check for the straight I mentioned it above but you'll have to work it out. You need to check that any dice is a 1 then a 2 then a 3 etc

    Well, tbh, I've never used families before. I've tried the instance variable, but that didn't add the score, well it did for the 5 only (50). I'm actually trying to understand this

  • > I'm saying the variable for faceval should become a family instance variable then it's easier. As for the logic to check for the straight I mentioned it above but you'll have to work it out. You need to check that any dice is a 1 then a 2 then a 3 etc

    Well, tbh, I've never used families before. I've tried the instance variable, but that didn't add the score, well it did for the 5 only (50). I'm actually trying to understand this

    Do I set the instance variable as a global variable

  • > > I'm saying the variable for faceval should become a family instance variable then it's easier. As for the logic to check for the straight I mentioned it above but you'll have to work it out. You need to check that any dice is a 1 then a 2 then a 3 etc

    >

    > Well, tbh, I've never used families before. I've tried the instance variable, but that didn't add the score, well it did for the 5 only (50). I'm actually trying to understand this

    Do I set the instance variable as a global variable

  • For pickedcount you can set it to a global if you want. There's more info on Families in the manual.

  • For pickedcount you can set it to a global if you want. There's more info on Families in the manual.

    Lionz, I know I've been asking a lot from you, which I do appreciate you helping me, which I know I've said one more thing for the Small and Large Straights, but there's one last thing I need help with, I DO PROMISE YOU. After the player chooses how many players are playing (2, 3, or 4), at the start of the game, each player will roll a dice to see who goes first. For example (2 players), both of them will roll a dice to see if their dice number is higher than the opposing player. If it's a tie, both players will re-roll until one of them wins the dice roll. EX: P1=3, P2=3, both will re-roll, now P1=4, and P2=5, which makes P2 go first. That should be easy right? But what about 3 and 4 players? If (3 players) P1=5, P2=4, and P3=5, then P1 and P3 will re-roll to determine who's going 1st and 2nd, while P2 will go last. The same thing will happen if they tie for 2nd and 3rd. The same thing will happen to 4 players. To determine the order. But if P1, P2, and P4 all tie to see who's going 1st, 2nd, and 3rd, but if P2 and P4 tie again for 2nd and 3rd, they will re-roll. If P2 has a higher number than P4, The order will go like this; P1 (1st), P2 (2nd), P4 (3rd), and P3 (4th). If all of them tie, they will all re-roll. This is just an example of the order, but with the same thing happening. If all of them tie, they will all re-roll. Can you help me one last time for my game?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)