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(); }
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(); } }