public UMultiBulletShooter() : base("MultiBulletShooter Upgrade")
 {
     Weapon = new MultiProjectileShooter
              (
         multiShot: Utility.RandomBetween(2, 5)
         , dispersion: Utility.RandomBetween(8, 20)
         , newProjectileCallback: (character, position, angle) =>
         new HeroBullet(character, position, angle)
              );
     Animation = TextureSetLoader.FIRE;
 }
Esempio n. 2
0
        public Hero() : base("Hero")
        {
            Animation = TextureSetLoader.SHIP1_BASE;
            MaxHealth = HERO_HEALTH;
            Health    = HERO_HEALTH;
            Speed     = HERO_SPEED;
            ShootingStrategy.ShootingInterval = 50;

            AddStrategy(new FlyingDirectionRotation
                        (
                            owner: this
                            , verticalOrientation: SpaceDirection.VerticalDirection.UP
                            , angleDeltaCount: 35
                            , maxAngleDegrees: 75
                        ));

            //Default weapon
            Weapon = new MultiProjectileShooter
                     (
                multiShot: 1
                , dispersion: 20
                , newProjectileCallback: (character, position, angle) =>
                new HeroBullet(character, position, angle)
                     );

            //He is composed of the thrust
            new MovementThrust(this);

            //Custom square intersect percentage
            IntersectStrategy = new SquareIntersect(this)
            {
                Percent = 60
            };

            //Hero uses our implementation of clickable event receiver
            Clickable = new ClickableImpl(IntersectsOn);

            //TODO fix this and implement ellipse intersect collision instead of default square

            /*IntersectStrategy = new DelegateIntersect
             * (
             *      this
             *      , (x, y) =>
             *      {
             *              float XRadius = (float)Width / 2;
             *              float YRadius = (float)Height / 2;
             *              float ellipsePosition = Utility.square(X - x - XRadius) / Utility.square(XRadius) +
             *                                                              Utility.square(Y - y - YRadius) / Utility.square(YRadius);
             *              if(ellipsePosition<1)Log.d(this, ellipsePosition.ToString());
             *              return ellipsePosition < 1;
             *      }
             * );*/
        }
Esempio n. 3
0
        public Lakebeam() : base("Lakebeam", score: 50)
        {
            Animation = TextureSetLoader.SHIP2_BASE;
            Direction = SpaceDirection.None + SpaceDirection.VerticalDirection.DOWN;

            Weapon = new MultiProjectileShooter
                     (
                multiShot: 1
                , dispersion: 0
                , newProjectileCallback: (character, position, angle) =>
                new FireBullet <IPlayer>(character, position, angle, speed: 6, damage: 8)
                     );
        }
Esempio n. 4
0
        public Venomflare() : base("Venomflare", score: 100)
        {
            Animation = TextureSetLoader.SHIP3_BASE;
            Direction = SpaceDirection.None + SpaceDirection.VerticalDirection.DOWN;

            Weapon = new MultiProjectileShooter
                     (
                multiShot: 2
                , dispersion: 10
                , newProjectileCallback: (character, position, angle) =>
                new FireBullet <IPlayer>(character, position, angle, speed: 15, damage: 12)
                     );
        }
Esempio n. 5
0
        //public float Angle
        //{
        //	get; set;
        //}

        public Waveghost() : base("Waveghost", score: 150)
        {
            Animation = TextureSetLoader.SHIP4_BASE;
            Direction = SpaceDirection.None + SpaceDirection.VerticalDirection.DOWN;
            RealSpeed = WAVEGHOST_SPEED;

            //Random rotation direction
            RotationDirection = Utility.RandomBetween(0, 1) == 0 ? CLOCKWISE : COUNTERCLOCKWISE;

            Weapon = new MultiProjectileShooter
                     (
                multiShot: 1
                , dispersion: 20
                , newProjectileCallback: (character, position, angle) =>
                new FireBullet <IPlayer>(character, position, angle, speed: 7, damage: 5)
                     );
        }
Esempio n. 6
0
        public DarkspringTheTwisted() : base("Darkspring The Twisted", score: 500)
        {
            Animation = TextureSetLoader.SHIP12_BASE;
            Direction = SpaceDirection.None + SpaceDirection.VerticalDirection.DOWN;

            MaxHealth = 600;
            Health    = MaxHealth;

            IntersectStrategy = new SquareIntersect(this)
            {
                Percent = 65
            };

            //Approaches slowly
            Speed = 1.5f;

            Weapon = new MultiProjectileShooter
                     (
                multiShot: 1
                , dispersion: 0
                , newProjectileCallback: (character, position, angle) =>
                new FireBullet <IPlayer>(character, position, angle, speed: 2, damage: 12)
                     );
        }