コード例 #1
0
        public TownNode(NobleQuestGame Game, Owners Owner) : base(Game)
        {
            this.HitPointMax = 1000;
            this.HitPoint    = 1000;
            this.Damage      = 5;

            this.Owner = Owner;

            this.HitBar = new HitPointBarEntity(this.Game);
            this.HitBar.AssociatedEntity = this;
            this.HitBar.Background       =
                this.Game.Content.Load <Texture2D>("TownHitBarBackground");
            this.HitBar.Foreground =
                this.Game.Content.Load <Texture2D>("TownHitBar");
            this.HitBar.UpdatePosition = false;
            if (this.Owner == Owners.PLAYER)
            {
                this.HitBar.Position.X = 10;
                this.HitBar.Position.Y = 10;
            }
            else
            {
                this.HitBar.Position.X =
                    this.Game.Graphics.PreferredBackBufferWidth - this.HitBar.Background.Width - 10;
                this.HitBar.Position.Y      = 10;
                this.HitBar.InvertDirection = true;
            }
        }
コード例 #2
0
        public DynamicEntity(NobleQuestGame Game)
        {
            this.Game = Game;
            State     = States.STOPPED;
            Direction = Directions.RIGHT;

            HitPointMax = 0;
            HitPoint    = 0;
            Damage      = 0;

            HitBar = new HitPointBarEntity(this.Game);
            HitBar.AssociatedEntity = this;
            HitBar.InitBar();

            VisitedPath = new List <NodeEntity>();
            ToVisitPath = new List <NodeEntity>();
        }