|
CreatingNewItems
This page describes how to implement new items in Snookiepoof
Phase-Implementation IntroductionItems represent a central concept in Snookiepoof. You can extend the game engine by adding new items. This page describes the normal steps you go through to create a new item. Remember to start by creating tests first. Tests for items are created in project Test.Snookiepoof.Core. Adding a new item classNew items are created in the Items folder in the Snookiepoof.Core project.
Sample item (with no behavior: [ItemName("table")]
public class Table : AbstractItem
{
}Item typesIn the ItemClassifications folder in Snookiepoof.Core you will find interfaces that should be inherited to give your new item specific behaviors.
Sample item that can be carried: [ItemName("knife")]
public class Knife : AbstractItem, ICanBeCarried
{
public Knife()
{
Weight = 500;
}
public int Weight { get; private set; }
}Add item to a gameIn order to use the item in a game it must be added to a game level. See creating new game levels. |
► Sign in to add a comment