public Human(int health, float movementSpeed, Point2D location, int dimension, Guid playerID) : base(health, movementSpeed, location, dimension, playerID) { Filing.Logging.MasterLog.DebugWriteLine("Living spawned at: " + location.ToString()); this.Visual = new AnimatedTexture(RenderLayer.Character, this.GetSequences(), TextureLoader.AnimationBaseCharacter, XMLPaths.BaseCharacterSpriteSheet, Assembly.GetAssembly(typeof(AssemblyGetter))); }
private static void DrawItems(Tile tile, Rectangle target) { Item tileItem = tile.MainObject as Item; if (tileItem != null) { ComponentHasTexture itemVisual = tileItem.GetExactComponent <ComponentHasTexture>(); Point2D topLeft = new Point2D(0, 0); int length = itemVisual.Visuals.Count; for (int i = 0; i < length; i++) { AbstractVisual visual = itemVisual.Visuals[i]; topLeft.X = target.X; topLeft.Y = target.Y; visual.Render(MapDrawer, topLeft); } ItemCountBounds.X = target.Location.X + (TileSize.X / 2); ItemCountBounds.Y = target.Location.Y + TileSize.Y; MapDrawer.DrawText(tileItem.CurrentlyStacked.ToString(), ItemCountBounds, ItemCountFont, SimpleTextRenderer.Alignment.Left, RenderLayer.MapItemCount); } }
/// <param name="visual">The visual representation of this floor to render.</param> /// <param name="walkable">If true it is possible to walk on this tile.</param> public Ceiling(AbstractVisual visual, bool walkable) { ComponentHasTexture textureComponent = new ComponentHasTexture(false); textureComponent.Visuals.Add(visual); this.AddComponent(textureComponent); this.Walkable = walkable; }
public Rock(int durability) : base(StoneName, durability) { this.HarvestingBehavior = new DropWhenCompletelyHarvested(new List <Base.Item> { new StoneRubble(this.Durability) }, SoundsTable.PickaxeHit, ""); visual = new StaticTexture(AssetManager.NameToIndex[this.GetRandomStoneTexture()], RenderLayer.Stone); }
/// <param name="visual">The visual representation of this floor to render.</param> /// <param name="walkable">If true it is possible to walk on this tile.</param> public Floor(AbstractVisual visual, bool walkable) : base(true) { ComponentHasTexture textureComponent = new ComponentHasTexture(false); textureComponent.Visuals.Add(visual); this.AddComponent(textureComponent); this.Walkable = walkable; }
/// <param name="durability"></param> /// <param name="isWalkable"></param> /// <param name="visual"></param> /// <param name="partID">A constant ID utilized to identify this part of a structure across all games and saves.</param> /// <param name="uniqueStructureID">The unique ID of the structure this part belongs to.</param> public StructurePart(int durability, bool isWalkable, AbstractVisual visual, Guid partID, Guid uniqueStructureID) : base(false) { this.PartID = partID; this.Durability = durability; this.Walkable = isWalkable; this.UniqueStructureID = uniqueStructureID; ComponentHasTexture textureComponent = new ComponentHasTexture(false); textureComponent.Visuals.Add(visual); this.AddComponent(textureComponent); }
public Rock() { visual = new StaticTexture(AssetManager.NameToIndex[this.GetRandomStoneTexture()], RenderLayer.Stone); }
/// <param name="priority"></param> /// <param name="offsetTexture">The texture that will be offset.</param> /// <param name="xOffset">The amount to offset the texture by.</param> /// <param name="yOffset">The amount to offset the texture by.</param> public OffsetTexture(int priority, AbstractVisual offsetTexture, int xOffset, int yOffset) : base(priority) { this.Texture = offsetTexture; this.XOffset = xOffset; this.YOffset = yOffset; }