Example #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            TextureManager.LoadContent(Content);

            player = new Player(KeyMouseReader.GetMousePosition());
            enemy  = new Enemy(new Vector2(Settings.ScreenWidth / 2, Settings.ScreenHeight / 2), player);
            player.Enemy(enemy);
        }
Example #2
0
        public override void Update(GameTime gt)
        {
            pos = KeyMouseReader.GetMousePosition() - Offset();

            if (KeyMouseReader.LeftPressed())
            {
                enemy.TargetHostile = true;
                if (enemy.currHealth > 1)
                {
                    enemy.currHealth -= 0.5f;
                }
            }
            else
            {
                enemy.TargetHostile = false;
            }
        }