Exemplo n.º 1
0
        public Entity CreateRocketLauncherEnemy()
        {
            var result = new Entity()
            {
                Health    = 3,
                Rectangle = new Rect(0, 0, 37, 26),
                Team      = Team.Enemy
            };

            var weapon = new WeaponConfig()
            {
                Damage            = 2,
                ProjectileCreator = CreateRocketShot,
                ShootSpeed        = 1
            };

            result.AddComponent(new RenderComponent(MainAtlas.GetFrame("rocketlauncher.png")));
            result.AddComponent(GetJetLongAnim(new Distance(35, 16)));
            result.AddComponent(new MovementComponent(75)
            {
                MoveLeft = true
            });
            result.AddComponent(new CollisionDamageComponent(1));
            result.AddComponent(new WeaponComponent(weapon)
            {
                ProjectileDirection = new Distance(-1, 0),
                FireOffset          = new Distance(-5, 2),
                TryFire             = true
            });

            result.Destroyed += SpawnMediumExplosionOnDeath;

            return(result);
        }
Exemplo n.º 2
0
        public Entity CreateBeamEnemy()
        {
            var result = new Entity()
            {
                Health    = 10,
                Rectangle = new Rect(0, 0, 49, 33),
                Team      = Team.Enemy
            };

            var weapon = new WeaponConfig()
            {
                Damage            = 2,
                ProjectileCreator = CreateBeamShot,
                ShootSpeed        = 4
            };

            result.AddComponent(new RenderComponent(MainAtlas.GetFrame("beamship.png")));
            result.AddComponent(new MovementComponent(40)
            {
                MoveLeft = true
            });
            result.AddComponent(new CollisionDamageComponent(1));
            result.AddComponent(new WeaponComponent(weapon)
            {
                ProjectileDirection = new Distance(-1, 0),
                FireOffset          = new Distance(2, 12),
                TryFire             = true
            });

            result.Destroyed += SpawnExplosionOnDeath;

            return(result);
        }
Exemplo n.º 3
0
        public Entity CreateShuttleEnemy()
        {
            var result = new Entity()
            {
                Health    = 1,
                Rectangle = new Rect(0, 0, 35, 19),
                Team      = Team.Enemy
            };

            var weapon = new WeaponConfig()
            {
                Damage            = 1,
                ProjectileCreator = CreateEnemyShot,
                ShootSpeed        = 3
            };

            result.AddComponent(new RenderComponent(MainAtlas.GetFrame("shuttle.png")));
            result.AddComponent(GetJetAnim(new Distance(36, 1)));
            result.AddComponent(GetJetAnim(new Distance(36, 15)));
            result.AddComponent(new MovementComponent(150));
            result.AddComponent(new CollisionDamageComponent(1));
            result.AddComponent(new WeaponComponent(weapon)
            {
                ProjectileDirection = new Distance(-1, 0),
                FireOffset          = new Distance(0, 8),
                TryFire             = true
            });
            result.AddComponent(new SineMotorComponent(0.8f));

            result.Destroyed += SpawnExplosionOnDeath;

            return(result);
        }
Exemplo n.º 4
0
        public Entity CreateDartEnemy()
        {
            var result = new Entity()
            {
                Health    = 1,
                Rectangle = new Rect(0, 0, 37, 26),
                Team      = Team.Enemy
            };

            var weapon = new WeaponConfig()
            {
                Damage            = 1,
                ProjectileCreator = CreateUpwardEnemyShot,
                ShootSpeed        = 0.8
            };

            result.AddComponent(new RenderComponent(MainAtlas.GetFrame("dart.png")));
            result.AddComponent(new MovementComponent(300)
            {
                MoveLeft = true
            });
            result.AddComponent(new CollisionDamageComponent(1)
            {
                DestroyOnCollide = true
            });
            // Top gun
            result.AddComponent(new WeaponComponent(weapon)
            {
                ProjectileDirection = new Distance(0, -1),
                FireOffset          = new Distance(21, 2),
                TryFire             = true
            });

            // Bottom gun
            result.AddComponent(new WeaponComponent(new WeaponConfig()
            {
                Damage            = 1,
                ProjectileCreator = CreateDownardEnemyShot,
                ShootSpeed        = 0.8,
            })
            {
                ProjectileDirection = new Distance(0, 1),
                FireOffset          = new Distance(21, 10),
                TryFire             = true
            });

            result.Destroyed += SpawnExplosionOnDeath;

            return(result);
        }
Exemplo n.º 5
0
        public Entity CreateUFOEnemy()
        {
            var result = new Entity()
            {
                Health    = 1,
                Rectangle = new Rect(0, 0, 18, 20),
                Team      = Team.Enemy
            };

            var weapon = new WeaponConfig()
            {
                Damage            = 1,
                ProjectileCreator = CreateOrbShot,
                ShootSpeed        = 1.5
            };

            result.AddComponent(new RenderComponent(MainAtlas.GetFrame("ufo.png")));
            result.AddComponent(new MovementComponent(75)
            {
                MoveLeft = true
            });
            result.AddComponent(new CollisionDamageComponent(1));
            result.AddComponent(new WeaponComponent(weapon)
            {
                ProjectileDirection = new Distance(-1, 0),
                FireOffset          = new Distance(6, 9),
                TryFire             = true,
                PlayerTracking      = true
            });
            result.AddComponent(new SineMotorComponent(1f));

            result.AddComponent(GetJetAnim(new Distance(6, 0), 90));
            result.AddComponent(GetJetAnim(new Distance(11, 20), 270));

            result.Destroyed += SpawnExplosionOnDeath;

            return(result);
        }