private void InitializeVariables() { SimpleFloor = Helper.INIParser.GetSetting("Rendering", "SimpleFloor") != "0"; SimpleTrapdoor = Helper.INIParser.GetSetting("Rendering", "SimpleTrapdoor") != "0"; SimpleBrokenWall = Helper.INIParser.GetSetting("Rendering", "SimpleBrokenWall") != "0"; _kcExit = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcExit")); _kcNorth = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcNorth")); _kcSouth = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcSouth")); _kcWest = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcWest")); _kcEast = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcEast")); _kcNorthwest = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcNorthwest")); _kcSouthwest = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcSouthwest")); _kcNortheast = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcNortheast")); _kcSoutheast = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcSoutheast")); _kcItem1 = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcItem1")); _kcItem2 = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcItem2")); _kcItem3 = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcItem3")); _kcRestart = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcRestart")); _kcSkip = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcSkip")); _kcSwingCw = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcSwingCw")); _kcSwingCcw = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcSwingCcw")); _kcWait = Helper.StringToKey(Helper.INIParser.GetSetting("Input", "kcWait")); InputDelayMax = int.Parse(Helper.INIParser.GetSetting("Game", "InputDelay")); TilesX = int.Parse(Helper.INIParser.GetSetting("Game", "TilesX")); TilesY = int.Parse(Helper.INIParser.GetSetting("Game", "TilesY")); RenderCells = new List<RenderCell>(); Particles = new List<Particle>(); CurrentTileset = Resources.GetRandomTileset(); TileSize = 14; InputDelay = 0; LastKeyPress = Keyboard.Key.Escape; TextInventory = new List<Text>(); SpriteInventory = new List<Sprite>(); Game = new Game(this, TilesX, TilesY) { SFMLGame = this }; Running = true; }
public static Entity GetNewEntity(Game game, ESpawnable es) { switch (es) { case ESpawnable.EsRoach: return new EntityRoach(game); case ESpawnable.EsRoachQueen: return new EntityRoachQueen(game); case ESpawnable.EsEvilEye: return new EntityEvilEye(game); case ESpawnable.EsGelBaby: return new EntityGelBaby(game); } return new EntityNull(game); }