コード例 #1
0
ファイル: EnemyPatterns.cs プロジェクト: shemloft/Game
 public EnemyPatternNothing(Game game, int lifetime)
 {
     Game          = game;
     EnemyFeatures = new EnemyFeatures {
         Lifetime = lifetime
     };
 }
コード例 #2
0
ファイル: EnemyPatterns.cs プロジェクト: shemloft/Game
        public EnemyPatternBombing(Game game, int enemyCount, EnemyFeatures features,
                                   Func <Enemy, ShootingPattern[]> shootingDirection)
        {
            Game = game;

            EnemyFeatures = features;

            this.enemyCount        = enemyCount;
            this.shootingDirection = shootingDirection;
        }
コード例 #3
0
ファイル: EnemyPatterns.cs プロジェクト: shemloft/Game
        //private readonly Func<Enemy, Vector[]> shootingDirection;

        public EnemyPatternExplosion(Game game, int enemyCount, int shootingFrequency, double bulletVelocity)
        {
            Game          = game;
            EnemyFeatures = new EnemyFeatures
            {
                BulletVelocity    = bulletVelocity,
                EnemyVelocity     = 2,
                Lifetime          = 150,
                ShootingFrequency = shootingFrequency
            };

            this.enemyCount = enemyCount;
        }
コード例 #4
0
 public BossFight(Game game, EnemyFeatures features, Point start, int hp)
 {
     Game               = game;
     EnemyFeatures      = features;
     EnemyFeatures.Boss = new Boss(start, Game, VectorMoves.BossMoves(new Vector(start)),
                                   EnemyFeatures.EnemyVelocity, EnemyFeatures.BulletVelocity)
     {
         HP = hp,
     };
     this.start = start;
     breakLen   = 200;
     phaseCount = 5;
 }
コード例 #5
0
ファイル: EnemyPatterns.cs プロジェクト: shemloft/Game
        public EnemyPatternDiagonal(Game game, Point leftStart, Point rightStart)
        {
            Game            = game;
            this.leftStart  = leftStart;
            this.rightStart = rightStart;

            EnemyFeatures = new EnemyFeatures
            {
                BulletVelocity    = 3,
                EnemyVelocity     = 4,
                Lifetime          = 250,
                ShootingFrequency = 20,
                SpawnFrequency    = 20
            };
        }
コード例 #6
0
ファイル: EnemyPatterns.cs プロジェクト: shemloft/Game
        public EnemyPatternHalfCircle(
            Point leftStart, Point rightStart, Game game,
            Func <Enemy, ShootingPattern[]> shootingDirection)
        {
            this.leftStart  = leftStart;
            this.rightStart = rightStart;
            Game            = game;

            EnemyFeatures = new EnemyFeatures
            {
                BulletVelocity    = 5,
                EnemyVelocity     = 3,
                Lifetime          = 500,
                ShootingFrequency = 50,
                SpawnFrequency    = 20
            };

            this.shootingDirection = shootingDirection;
        }
コード例 #7
0
ファイル: Dialog.cs プロジェクト: shemloft/Game
        public Dialog(Game game, DialogInfo info, string[] playerPhrases, string[] bossPhrases)
        {
            Game = game;
            var count = 0;

            boss = new Boss(info.BossSpawnPoint, game, VectorMoves.MoveToTarget(new Vector(info.BossSpawnPoint),
                                                                                new Vector(info.BossStartPoint)), 1, 1, true)
            {
                Name = info.BossName,
                HP   = 10
            };
            Phrases = new Queue <Tuple <ICharacter, string, string> >(playerPhrases
                                                                      .Zip(bossPhrases, (x, y) => x + "\r" + y)
                                                                      .SelectMany(x => x.Split('\r'))
                                                                      .ToList()
                                                                      .Select(x => Tuple.Create(
                                                                                  ++count % 2 == 0 ? (ICharacter)boss : (ICharacter)game.Player,
                                                                                  count % 2 == 0 ? boss.Name : game.Player.Name, x)));
            phraseLifetime = 200;
            EnemyFeatures  = new EnemyFeatures
            {
                Lifetime = Phrases.Count * phraseLifetime
            };
        }