Yatzy Dice Game

Play online

Yatzy Dice Game is a game where the player rolls five dice to attempt to make different combinations.  After each roll, the player can hold the value of any of the die by clicking on them.  A saved die turns yellow when its value is held.  After three rolls, the player must choose one of the available categories to apply the score.  After all of the categories are completed, the game is over.

Scoring Categories

Aces – Sum of all the dice showing value value of 1.

Twos – Sum of all the dice showing value value of 2.

Threes – Sum of all the dice showing value value of 3.

Fours – Sum of all the dice showing value value of 4.

Fives – Sum of all the dice showing value value of 5.

Sixes – Sum of all the dice showing value value of 6.

Bonus for getting over 63 points in all of the above categories.

One Pair – Two dice have a matching value.

Two Pairs – Four dice have two different matching values

Three of a Kind – Three dice have the same value

Four of a Kind – Four dice have the same value.

Small Straight – Dice have the values 1 through 5.

Large Straight – Dice have the values 2 through 6.

Chance – Sum of all dice values.  Basically, choose this if no other category applies.

Full House – Three dice have one value and two dice have another value.

Yatzy – All five dice have the same value.

Calculating the rolled dice value

Below is the code used for determining which value rolled, based on the transform rotation of the Unity GameObject.  This assumes that the die is modeled with 4 on top, 3 on bottom, 2 on front, 5 on back, 1 on left, and 6 on right.

    public int getValue () {
        int iValue = -1;
        Vector3 dieRotation = gameObject.transform.eulerAngles;

        dieRotation = new Vector3 (Mathf.RoundToInt (dieRotation.x), Mathf.RoundToInt (dieRotation.y), Mathf.RoundToInt (dieRotation.z));

        if (dieRotation.x == 180 && dieRotation.y == 270 ||
            dieRotation.x == 0 && dieRotation.z == 90) {
            iValue = 1;
        } else if (dieRotation.x == 270) {
            iValue = 2;
        } else if (dieRotation.x == 180 && dieRotation.z == 0 ||
            dieRotation.x == 0 && dieRotation.z == 180) {
            iValue = 3;
        } else if (dieRotation.x == 180 && dieRotation.z == 180 ||
            dieRotation.x == 0 && dieRotation.z == 0) {
            iValue = 4;
        } else if (dieRotation.x == 90) {
            iValue = 5;
        } else if (dieRotation.x == 0 && dieRotation.z == 270 ||
            dieRotation.x == 180 && dieRotation.z == 90) {
            iValue = 6;
        }

        //        Debug.Log("eulerAngles: " + dieRotation.x + ", " + dieRotation.y + ", " + dieRotation.z + " Value: " + iValue);

        return iValue;
    }

 

 

 

Released

XNA Model Animation

https://www.youtube.com/watch?v=qndvb8N91j0

Demonstration of switching between 2D and 3D rendering, along displaying an animated Blender model in XNA

Today, I worked on getting my simple character model animation to display in the game world.  Currently, the player model displays fine, but it does not display the arms and legs moving as the player moves.  I found quite a few references for animating a Model, but none were very simplistic.  One thing in common with all of the examples is that model animations are not handled “out of the box” by XNA.  The technique used requires that the animation information be extracted from the model using the “Tag” property, which is sent to a custom Pipeline animation processor.  Two good examples of how to do this are the Microsoft SkinnedSample project and Michael Neel’s XNA 3D Primer.  Using these references, I was able to get my player model moving in a XNA game window.

screen081

However, I found that the method I was using to generate the sprite animations was not compatible with importing for 3D animations.  The process for preparing a Blender model for export to FBX format for XNA is nicely explained in this article by StormCode.  Using that information, I was able to use the Action Editor in Blender to create a named animation.  In the 2.6 version of Blender, this is located under the DopeSheet screen.  The article also gives valuable tips on how to create a keyframe containing all bone information and how to duplicate keyframes.  Previously, I used the record button in Blender to create keyframes, but that only records the bones that are actually changed.

After exporting my model to FBX format, I was able to import it into the SkinnedSample project.  I created new Model and Animation objects for my model.  That project is covered by the Microsoft Permissive License (Ms-PL), so I think I can use that code in my own project.  However, before I do that I want to compile it into its own library, so I can just link it and pass my models to it without having to add Microsoft’s code to my own project.  The only problem I’ve seen so far is that some polygons will sometimes incorrectly overlap each other, so that is something I will need to resolve.

screen082

While I was working on the game screen, I was able to resolve the issue with the model appearing so dark.  This was because the diffuse property on the mesh effect needed to be set to White.

World of Warcraft

Characters

Mage PulpJackson

PulpJackson was my main character which I played for many years on the Draenor realm.  I went on raids with the Champions of Valor guild and was an officer for a few years.

My most popular video on YouTube is a video of me explaining how to play the Frostfire mage class.

Paladin SixSigma

SixSigma (originally Gitcommand) was the first character I created in World of warcraft.  I later switched due to the lack of roles for Paladins (aside from buffing) in raids.

Druid CoreDump

CoreDump was my druid, which I created to fill the healing role in groups.

Warlock HardJustice

HardJustice was a warlock that I created, but I never seriously raided with him.

Death Knight GreedIsGood

GreedIsGood (named after an old Warcraft cheat code) was a death knight that I created but never seriously played.

Hunter DesmondWolfe

DesmondWolfe was a hunter that I created to test out the wolf shape shifting  class.

World of Warcraft Videos

Below are a few videos that I created when I played World of Warcraft.