예제 #1
0
        internal Projectile(Vector2 direction, EntityBase entity, GameBase game, long projectileIdentifier, int lifeEndTurn)
        {
            if (!direction.IsUnitVector)
            {
                direction = direction.Unit; //Bug: .Unit is slightly inaccurate, causing the above check to fail :S this is a workaround
            }
            //throw new ArgumentException("Not a direction (unit vector)", nameof(direction));

            Position             = entity.Position + direction * (entity.CharData.HitboxSize + entity.CharData.ProjectileHitboxSize);
            Direction            = direction;
            HitboxSize           = entity.CharData.ProjectileHitboxSize;
            Damage               = entity.CharData.ProjectileDamage;
            PlayerIdentifier     = entity.PlayerIdentifier;
            EntityIdentifier     = entity.EntityIdentifier;
            ProjectileIdentifier = projectileIdentifier;
            LifeEndTurn          = lifeEndTurn;
            ProjectileSpeedSec   = entity.CharData.ProjectileSpeedSec;

            Game = game;
        }
예제 #2
0
 public Entity(CharacterData charData, Vector2 position, long playerIdentifier, long entityIdentifier, GameBase game) : base(charData, position, playerIdentifier, entityIdentifier, game)
 {
 }
예제 #3
0
        public EntityBase(CharacterData charData, Vector2 position, long playerIdentifier, long entityIdentifier, GameBase game)
        {
            CharData         = charData;
            Game             = game;
            EntityIdentifier = entityIdentifier;
            Health           = CharData.MaxHealth;
            PlayerIdentifier = playerIdentifier;
            Position         = position;

            MovingTo = Position;
        }