예제 #1
0
파일: HUD.cs 프로젝트: KSherry/GitFYP
        public void Update(Player player, GameTime gameTime)
        {
            health = (int)MathHelper.Clamp(health, 0, 100);
            shield = (int)MathHelper.Clamp(shield, 0, 100);
            capacity = (int)MathHelper.Clamp(capacity, 0, 15);

            health = (int)player._health;
            shield = (int)player._shield;
            capacity = (int)player.capacity;
            playerPosition = player._pos;
        }
예제 #2
0
파일: Game1.cs 프로젝트: KSherry/GitFYP
        protected override void Initialize()
        {
            player = new Player();
            hud = new HUD();
            children.Add(player);

            for (int i = 0; i < children.Count; i++)
            {
                children[i].Initialize();
            }

            base.Initialize();
        }