public LinearSpell(ulong id, Teams team, Vec2 position, Vec2 target, SpellTypes type, ICharacter owner) : base(id, position, SpellsHelper.Info(type).Speed, SpellsHelper.Info(type).Width, SpellsHelper.Info(type).Width) { Info = SpellsHelper.Info(type); IsSolid = Info.Solid; Type = type; Velocity = Vec2.Normalize(target - position) * MoveSpeed; StartPosition = (Vec2)position.Clone(); Team = team; Owner = owner; }
/// <summary> /// Creates an AABB object using the given bounding vertices. /// </summary> /// <param name="lowerVertex">the bottom left vertex of the bounding box</param> /// <param name="upperVertex">the top right vertex of the bounding box</param> public AABB(Vec2 lowerVertex, Vec2 upperVertex) { LowerBound = lowerVertex.Clone(); // clone to be safe UpperBound = upperVertex.Clone(); }