public EntityItem(string name, string itemName, StaticSprite sprite) { this.name = name; this.itemName = itemName; itemSprite = sprite; drawArray = new Drawable[] { sprite }; }
public Item(string name, StaticSprite itemSprite, string placeResult, int maxStack) { this.name = name; this.itemSprite = itemSprite; this.placeResult = placeResult; this.maxStack = maxStack; }
private Item CreateGreenhouse() { IntRect bounds; StaticSprite itemIcon = new StaticSprite(textureAtlases.GetTexture("greenhouseItem", out bounds), bounds, Drawable.DrawLayer.Item); return(new Item("Greenhouse", itemIcon, "Greenhouse", 100)); }
private Item CreateCopperOre() { IntRect bounds; StaticSprite itemIcon = new StaticSprite(textureAtlases.GetTexture("CopperOreItem", out bounds), bounds, Drawable.DrawLayer.Item); return(new Item("Copper Ore", itemIcon, null, 100)); }
private Item CreateFurnace() { IntRect bounds; StaticSprite itemIcon = new StaticSprite(textureAtlases.GetTexture("FurnaceItem", out bounds), bounds, Drawable.DrawLayer.Item); return(new Item("Furnace", itemIcon, "Furnace", 50)); }
private Entity CreateGreenhouse() { IntRect bounds; Animation working = new Animation(textureAtlases.GetTexture("greenhouseworking", out bounds), bounds.Width, bounds.Height, 1, bounds, new Vector2f(0, -48)); working.drawLayer = Drawable.DrawLayer.EntitySorted; StaticSprite idle = new StaticSprite(textureAtlases.GetTexture("greenhouse", out bounds), bounds, new Vector2f(0, -48)); idle.drawLayer = Drawable.DrawLayer.EntitySorted; Animation shadow = new Animation(textureAtlases.GetTexture("greenhouseshadow", out bounds), bounds.Width, bounds.Height, 1, bounds, new Vector2f(96, -16)); shadow.drawLayer = Drawable.DrawLayer.Shadow; Machine greenhouse = new Machine("Greenhouse", working, idle, shadow); greenhouse.miningProps = new Entity.MiningProps("Greenhouse", 1, 60, 0, ""); greenhouse.collisionMask = Base.CollisionLayer.EntityPhysical | Base.CollisionLayer.TerrainSolid; greenhouse.mapColor = new Color(96, 64, 0); greenhouse.minable = true; greenhouse.emissionPerSecond = 1.0f; greenhouse.collisionBox = new BoundingBox(-85, -80, 85, 48); greenhouse.drawingBox = new BoundingBox(192, 192); greenhouse.selectionBox = new BoundingBox(-96, -112, 96, 48); greenhouse.tileAligned = true; greenhouse.tileWidth = 6; greenhouse.tileHeight = 4; greenhouse.lightSourceFlicker = new LightSourceFlicker(400.0f, textureAtlases.GetTexture("lightsource", out bounds), bounds); return(greenhouse); }
public Furnace(string name, StaticSprite furnaceShadow, StaticSprite furnace) { this.name = name; this.furnace = furnace; this.furnaceShadow = furnaceShadow; drawArray = new Drawable[] { furnaceShadow, furnace }; }
//Define items prototypes here: private Item CreatePineSapling() { IntRect bounds; StaticSprite itemIcon = new StaticSprite(textureAtlases.GetTexture("woodItem", out bounds), bounds, Drawable.DrawLayer.Item); return(new Item("Pine Sapling", itemIcon, "Pine Tree 1", 100)); }
public new StaticSprite Clone() { StaticSprite cloned = new StaticSprite(this.texture, this.textureFrame, new Vector2f(this.drawOffset.X, this.drawOffset.Y)); cloned.drawLayer = this.drawLayer; cloned.scale = new Vector2f(this.scale.X, this.scale.Y); cloned.color = new Color(this.color); return(cloned); }
public Recipe GrowWoodRecipe() { IntRect bounds; StaticSprite recipeIcon = new StaticSprite(textureAtlases.GetTexture("woodItem", out bounds), bounds, Drawable.DrawLayer.None); Recipe recipe = new Recipe("Grow Wood", new int[0], new string[0], new int[] { 1 }, new string[] { "Wood" }, 180, recipeIcon); recipe.canBeMadeIn = new string[] { "Greenhouse" }; return(recipe); }
public Recipe(string name, int counts, string itemRequired, int countResult, string itemResult, int recipeTime, StaticSprite recipeSprite) { this.name = name; this.counts = new int[] { counts }; this.itemsRequired = new string[] { itemRequired }; this.countsResult = new int[] { countResult }; this.itemsResults = new string[] { itemResult }; this.recipeTime = recipeTime; this.recipeSprite = recipeSprite; }
public Tree(string name, StaticSprite trunk, Animation leaves, Animation shadow) { this.name = name; this.trunk = trunk; this.leaves = leaves; this.shadow = shadow; leaves.currentFrame = 3; shadow.currentFrame = 3; drawArray = new Drawable[] { trunk, leaves, shadow }; }
public Recipe(string name, int[] counts, string[] itemsRequired, int[] countsResult, string[] itemsResults, int recipeTime, StaticSprite recipeSprite) { this.name = name; this.counts = counts; this.itemsRequired = itemsRequired; this.countsResult = countsResult; this.itemsResults = itemsResults; this.recipeTime = recipeTime; this.recipeSprite = recipeSprite; }
public Machine(string name, Animation working, StaticSprite idle, Animation shadow) { this.name = name; this.working = working; this.shadow = shadow; this.idle = idle; if (idle != null) { drawArray = new Drawable[] { idle, shadow }; } else { drawArray = new Drawable[] { working, shadow }; } machineState = MachineState.Idle; input = new List <ItemStack>(); result = new List <ItemStack>(); }
public Entity CreateCoal() { IntRect bounds; StaticSprite coalOreSprite = new StaticSprite(this.textureAtlases.GetTexture("CoalOre", out bounds), bounds, Drawable.DrawLayer.Resource); coalOreSprite.drawLayer = Drawable.DrawLayer.Resource; coalOreSprite.scale = new Vector2f(0.5f, 0.5f); Resource coalOre = new Resource("Coal", coalOreSprite); coalOre.tileAligned = true; coalOre.tileHeight = 1; coalOre.tileWidth = 1; coalOre.collisionBox = new BoundingBox(32, 32); coalOre.collisionMask = Base.CollisionLayer.Resource; coalOre.selectionBox = new BoundingBox(32, 32); coalOre.drawingBox = new BoundingBox(32, 32); coalOre.minable = true; coalOre.miningProps = new Entity.MiningProps("Coal Ore", 1, 30, 0, ""); return(coalOre); }
private void LoadItemEntityPrototypes(ItemCollection itemCollection) { //Iterate over itemcollection and create an itementity prototype for each in the collection Dictionary <string, Item> items = itemCollection.GetItemCollection(); foreach (string key in items.Keys) { StaticSprite itemSprite = items[key].itemSprite.Clone(); itemSprite.scale = new Vector2f(0.5f, 0.5f); itemSprite.drawLayer = Drawable.DrawLayer.Item; Entity itemEntity = new EntityItem(key + "Item", key, itemSprite); itemEntity.selectionBox = new BoundingBox(16, 16); itemEntity.drawingBox = new BoundingBox(16, 16); itemEntity.collisionBox = new BoundingBox(16, 16); itemEntity.collisionMask = Base.CollisionLayer.Item | Base.CollisionLayer.EntityPhysical | Base.CollisionLayer.TerrainSolid; itemEntity.miningProps = new Entity.MiningProps(key, 1, 10, 0, ""); itemEntity.minable = true; entityPrototypes.Add(key + "Item", itemEntity); } }
public Entity CreateFurnace() { IntRect bounds; StaticSprite furnace = new StaticSprite(textureAtlases.GetTexture("furnace", out bounds), bounds, new Vector2f(0, -32)); StaticSprite furnaceshadow = new StaticSprite(textureAtlases.GetTexture("furnaceshadow", out bounds), bounds, new Vector2f(36, 0)); furnaceshadow.scale = new Vector2f(0.5f, 0.5f); furnace.drawLayer = Drawable.DrawLayer.EntitySorted; furnaceshadow.drawLayer = Drawable.DrawLayer.Shadow; Furnace furnaces = new Furnace("Furnace", furnaceshadow, furnace); furnaces.miningProps = new Entity.MiningProps("Furnace", 1, 60, 0, ""); furnaces.collisionMask = Base.CollisionLayer.EntityPhysical | Base.CollisionLayer.TerrainSolid; furnaces.minable = true; furnaces.emissionPerSecond = 1.0f; furnaces.collisionBox = new BoundingBox(64, 32); furnaces.drawingBox = new BoundingBox(192, 192); furnaces.selectionBox = new BoundingBox(64, 64); furnaces.tileAligned = true; furnaces.tileWidth = 2; furnaces.tileHeight = 1; return(furnaces); }
private Entity CreatePineTree1() { IntRect bounds; StaticSprite trunk = new StaticSprite(textureAtlases.GetTexture("tree", out bounds), new IntRect(bounds.Left, bounds.Top, bounds.Width / 4, bounds.Height), new Vector2f(0, -64)); trunk.drawLayer = Drawable.DrawLayer.EntitySorted; Animation leaves = new Animation(textureAtlases.GetTexture("tree", out bounds), 128, bounds.Height, 1, bounds, new Vector2f(0, -64)); leaves.drawLayer = Drawable.DrawLayer.EntitySorted; Animation shadow = new Animation(textureAtlases.GetTexture("treeshadow", out bounds), 192, bounds.Height, 1, bounds, new Vector2f(32, 0)); shadow.drawLayer = Drawable.DrawLayer.Shadow; Tree pineTree1 = new Tree("Pine Tree 1", trunk, leaves, shadow); pineTree1.collisionMask = Base.CollisionLayer.EntityPhysical | Base.CollisionLayer.TerrainSolid; pineTree1.mapColor = new Color(32, 160, 0); pineTree1.miningProps = new EntityPhysical.MiningProps("Wood", 1, 90, 0, ""); pineTree1.miningSounds = new string[] { "Chop1", "Chop2", "Chop3" }; pineTree1.minable = true; pineTree1.collisionBox = new BoundingBox(16, 16); pineTree1.drawingBox = new BoundingBox(128, 192); pineTree1.selectionBox = new BoundingBox(32, 32); return(pineTree1); }
public Resource(string name, StaticSprite resource) { this.name = name; this.resourceSprite = resource; drawArray = new Drawable[] { resource }; }