Example #1
0
 protected Entity(Position position, World world, Size size, int health, int maxHealth)
 {
     Position  = position;
     World     = world;
     Health    = health;
     MaxHealth = maxHealth;
     _size     = size;
     GodMode   = new GodMode();
 }
Example #2
0
        public override void OnTick(int currentTick)
        {
            foreach (var entity in World.EntityManager.Entities)
            {
                if (entity is Enemy enemy)
                {
                    if (CollidesWith(enemy))
                    {
                        enemy.Attack(1);
                        Attack(1);
                    }
                }
            }

            //100 tic 이후로 godMode 해제
            if (GodMode.IsGodMode && currentTick > GodMode.GodModeStartTick + 100)
            {
                GodMode.EndGodMode();
            }
        }