public MovementModule CreateEmptyModule( SKPoint coords, SKSize size, SKSize explSize, float xCoordLimit = 0 ) { MovementModule module = new MovementModule(coords, size, explSize, xCoordLimit); return(module); }
public MovementModule CreateHorizontalModule( SKPoint coords, SKSize size, SKSize explSize, float speed, float xCoordLimit = 0 ) { MovementModule module = CreateEmptyModule(coords, size, explSize, xCoordLimit); module.AddUnit(new LinearMovUnit(new SKPoint(speed, 0))); return(module); }
public MovementModule CreateCircularModule( SKPoint coords, SKSize size, SKSize explSize, float xSpeed, float radius, float cycleDuration, float xCoordLimit = 0 ) { MovementModule module = CreateEmptyModule(coords, size, explSize, xCoordLimit); module.AddUnit(new LinearMovUnit(new SKPoint(xSpeed, 0))); module.AddUnit(new CircularMovUnit(radius, cycleDuration)); return(module); }
public MovementModule Copy(SKPoint coords) { MovementModule module = new MovementModule(); module.coords = new SKPoint( this.coords.X + coords.X, this.coords.Y + coords.Y ); module.size = new SKSize(size.Width, size.Height); module.explSize = new SKSize(explSize.Width, explSize.Height); module.movementModuleUnits = new List <MovementModuleUnit>(); foreach (var unit in movementModuleUnits) { module.movementModuleUnits.Add(unit.Copy()); } module.rotation = rotation; return(module); }
public MovementModule CreateZigZagModule( SKPoint coords, SKSize size, SKSize explSize, float xSpeed, float ySpeed, float yRange, float xCoordLimit = 0 ) { MovementModule module = CreateEmptyModule(coords, size, explSize, xCoordLimit); module.AddUnit(new LinearMovUnit(new SKPoint(xSpeed, 0))); float cycleDuration = Math.Abs(yRange / ySpeed); module.AddUnit(new BackAndForthMovUnit(new SKPoint(0, ySpeed), cycleDuration)); return(module); }