Ejemplo n.º 1
0
        public virtual void Draw()
        {
            var localX = this.XPosition - NoxicoGame.CameraX;
            var localY = this.YPosition - NoxicoGame.CameraY;

            if (localX >= Program.Cols || localY >= Program.Rows || localX < 0 || localY < 0)
            {
                return;
            }
            var b = ((MainForm)NoxicoGame.HostForm).IsMultiColor ? TileDefinition.Find(this.ParentBoard.Tilemap[this.XPosition, this.YPosition].Index, true).Background : this.BackgroundColor;

            if (ParentBoard.IsLit(this.YPosition, this.XPosition))
            {
                NoxicoGame.HostForm.SetCell(localY, localX, this.Glyph, this.ForegroundColor, b);
            }
            //else
            //	NoxicoGame.HostForm.SetCell(localY, localX, this.Glyph, this.ForegroundColor.Night(), b.Night());
        }
Ejemplo n.º 2
0
 public virtual bool CanSee(Entity other)
 {
     foreach (var point in Toolkit.Line(XPosition, YPosition, other.XPosition, other.YPosition))
     {
         //if ((ParentBoard.IsSolid(point.Y, point.X) && !ParentBoard.IsWater(point.Y, point.X)) && ParentBoard.IsLit(point.Y, point.X))
         if (ParentBoard.IsSolid(point.Y, point.X, SolidityCheck.Projectile) && ParentBoard.IsLit(point.Y, point.X))
         {
             return(false);
         }
     }
     return(true);
 }