public BornState(GeomCloneLevel setCurrentLevel, Actor owner) : base(setCurrentLevel, owner, null) { Owner.ChangeAnimation(new Flash(setCurrentLevel, Owner, 400)); }
public BornState(GeomCloneLevel level, Actor owner, Animation bornAnimation) : base(level, owner, bornAnimation) { timeOutCount = 0; }
public PlayerBorn(GeomCloneLevel level, Actor owner) : base(level, owner) { }
public ActorState(GeomCloneLevel setCurrentLevel, Actor setOwner, Animation setAnimation) { owner = setOwner; currentLevel = setCurrentLevel; Owner.ChangeAnimation(setAnimation); }
public NormalState(GeomCloneLevel setCurrentLevel, Actor owner) : base(setCurrentLevel, owner, null) { Owner.ChangeAnimation(new NoAnimation(setCurrentLevel, Owner)); }
public NormalState(GeomCloneLevel level, Actor owner, Animation normalAnimation) : base(level, owner, normalAnimation) { }
public Animation(GeomCloneLevel setCurrentLevel, Actor setOwner) { owner = setOwner; currentLevel = setCurrentLevel; }
public FadeOutDead(GeomCloneLevel level, Actor owner) : base(level, owner) { }
public Spin(GeomCloneLevel game, Actor owner, float setDegreesPerSecond) : base(game, owner) { degreesPerMilliSecond = setDegreesPerSecond / 1000; }
public NoAnimation(GeomCloneLevel level, Actor owner) : base(level, owner) { }
public Flash(GeomCloneLevel level, Actor owner, float setTimeInterval) : base(level, owner) { timeInterval = setTimeInterval; }
public override bool CollidesWith(Actor a) { Vector2 scale = new Vector2(referenceWidth,referenceHeight); float distSquare = Vector2.DistanceSquared(a.Position * scale, Position * scale); // approximate square formula for (radius-20)*(radius-20) return distSquare < radius * radius && distSquare > radius * radius - 2.0f * radius * 20.0f; }
public virtual bool CollidesWith(Actor a) { if (Collidable && a.Collidable) if (Vector2.DistanceSquared(Position, a.Position) <= (BRadius + a.BRadius) * (BRadius + a.BRadius)) foreach (ActorPart myPart in parts) { foreach (ActorPart otherPart in a.Parts) if (myPart.collidesWith(otherPart)) return true; } return false; }