Beispiel #1
0
 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)));
 }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        /// <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;
        }
Beispiel #4
0
 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);
 }
Beispiel #5
0
        /// <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;
        }
Beispiel #6
0
        /// <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);
        }
Beispiel #7
0
 public Rock()
 {
     visual = new StaticTexture(AssetManager.NameToIndex[this.GetRandomStoneTexture()], RenderLayer.Stone);
 }
Beispiel #8
0
 /// <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;
 }