Fun Infused Games  |   Smooth Operator

  Home   |    Archive   |    About
Awardments for your XBLIG Part 1
Date 10/3/2011    Tags XBLIG, XNA    (0)

One feature everyone seems to love about Xbox Live Arcade is the inclusion of Achievements. Sadly this is a feature that has never been allowed officially in Xbox Live Indie Games, but that doesn't mean you cannot roll your own similar system (though there is no way to add to a gamer's player score). I have used a system of "Awardments" in my previous release Hypership Out of Control and in my upcoming release Volchaos. And now thanks to the magic of sharing, you can too!

To start with, create a new Awardment class in your project. For each Awardment we add, we will need a type and we will be creating an enum type to hold that type (below is an enum example from Volchaos).
public enum AwardmentType
{
    YouCompleteMe,
    CollectAllGems,
    GluttonForPunishment,
    LevelWithoutDeath
}

For the Awardment class itself, you will need something that looks like this:
public class Awardment
{
    public string Description
    {
        get;
        set;
    }

    public string AwardmentName
    {
        get;
        set;
    }

    public AwardmentType CurrentAwardmentType
    {
        get;
        set;
    }

    public bool Complete
    {
        get;
        set;
    }

    public Awardment(AwardmentType initialAwardmentType)
    {
        this.CurrentAwardmentType = initialAwardmentType;
        this.Complete = false;

        switch (CurrentAwardmentType)
        {
            case AwardmentType.YouCompleteMe:
                {
                    this.Description = "Finish All Forty Levels";
                    this.AwardmentName = "You Complete Me";
                    break;
                }
            case AwardmentType.CollectAllGems:
                {
                    this.Description = "Collect All Gems in a Level";
                    this.AwardmentName = "Got Those Gems";
                    break;
                }
            case AwardmentType.GluttonForPunishment:
                {
                    this.Description = "Die 100 Times";
                    this.AwardmentName = "Glutton For Punishment";
                    break;
                }
            case AwardmentType.LevelWithoutDeath:
                {
                    this.Description = "Complete a level without dieing";
                    this.AwardmentName = "Death Sucks";
                    break;
                }
        }
    }
}

AwardmentName is a short name for your Awardment, Description is a more in-depth name that details how to complete the Awardment, Complete flags if it is finished or not, and CurrentAwardmentType is going to tell you what type (based on the enum we created earlier) of Awardment this is.

This is the basic Awardment class. In part 2 (coming soon) we will create a collection to hold all the Awardments in your game and setup how to check if the Awardments have been completed.

Let me know if you have questions, comments, or suggestions in the comments below.


This article has been view 1123 times.


Comments

No comments for this article.


Add Comments

Name *
Website
  Name the animal in the picture below:

*
Comment *
Insert Cancel
Things To Click


Tags
Video Games (7)  Trivia or Die (3)  SQL (1)  iOS (3)  Game Dev (11)  Advise (14)  PC (1)  World of Chalk (2)  FIN (20)  Abduction Action! (27)  XBLIG (32)  Abduction Action (1)  Nastier (4)  ASP.net (18)  Absurd (2)  Volchaos (11)  Web (19)  Fin (1)  XNA (40)  Rant (50)  Cool (2)  Visual Studio (1)  Trivia Or Die (1)  Xbox (1)  C# (14)  Sports (11)  Design (2)  Development (13)  Hypership (28)  WP7 (8)  VolChaos (1)  Nasty (34)  Abdction Action! (1)