Dice Games

Game Editor comments and discussion.

Dice Games

Postby pesto126 » Sun Aug 27, 2006 2:54 pm

Hi. searched the forums and google but wasn't able to find anything regarding some games made with GE in the Dice genre.. ie: Yahtzee.. I was hoping to make a Yathz type game... but was looking for some sample code to help out.

Specifics:
Scorecard visible on screen.. clickable areas to add score.
Roll Dice button to roll 6 dice
Mini buttons/lights under dice to indicate hold/roll
Need a matrix to hold valid dice rolls to indicate scores that are valid
Perhaps animation for the dice on roll

Any help would be greatly appreciated.. trying to determine if actors should be made in parent/child or all dice as seperate actors? thx.
pesto126
 
Posts: 3
Joined: Sun Nov 27, 2005 12:55 pm
Score: 0 Give a positive score

Postby makslane » Mon Aug 28, 2006 5:42 pm

Try this:

1) Create an actor 'dice' and put 6 different animations.
2) In the 'Create Actor' event select an random animation:

Code: Select all
//Get a random index from 0 to 5
int anim = round(rand(5));

//Use the index to change the current animation
ChangeAnimation("Event Actor", getAnimName(anim), FORWARD);


Other way, is use a single animation with 6 frames, so, you can use the animpos variable to change the current frame:

Code: Select all
animpos = round(rand(5));


In this case, make sure stop the animation when create the actor (Change Animation Direction)

3) If you need to roll 6 dice actors, just clone the dice, create an button actor and, in a 'Mouse Button Down' event send an Activation Event for each dice. In the dice actor, put the above script in the Activation Event handler.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron