Fun Infused Games  |   Smooth Operator RSS 

  Home   |    Archive   |    Subscribe   |    Search   |    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


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