Exemple #1
0
        public MovementModule CreateEmptyModule(
            SKPoint coords,
            SKSize size,
            SKSize explSize,
            float xCoordLimit = 0
            )
        {
            MovementModule module = new MovementModule(coords, size, explSize, xCoordLimit);

            return(module);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }