Esempio n. 1
0
        public void ReduceHealth(Context context)
        {
            if (context.GetPlayer().health > 0)
            {
                context.GetPlayer().health -= 1;
            }

            if (context.GetPlayer().health <= 0)
            {
                context.GetPlayer().x = -25;
                context.GetPlayer().y = -25;
                context.SetState(new Dead());
            }
        }