コード例 #1
0
        public ProcessResult Process(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            //キー処理
            KeyGet(input);

            //描画処理
            Draw(g);

            if (IsDead)
            {
                uc.StageType   = (EStageType)Stage;
                takeOver.Stock = Stock;
                return(new ProcessResult()
                {
                    IsDead = IsDead,
                    NextState = new Control(uc, takeOver, dInfo, input, Operator)
                    {
                        IsPlaying = true,
                    },
                    UserChoice = uc,
                    TakeOver = takeOver
                });
            }
            else
            {
                return new ProcessResult()
                       {
                           IsDead = IsDead, NextState = this
                       }
            };
        }
コード例 #2
0
        public ProcessResult Process(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            NowCrashingBlockOrGettingItem = false;

            if (!IsCaught || IsSmall)
            {
                Move();
            }

            UpdateOverlapping();

            //キー処理
            KeyGet(input);

            if (PenetratingCount > 0)
            {
                --PenetratingCount;
                if (PenetratingCount == 0)
                {
                    Penetrability = EPenetrability.NON_PENETRATING;
                }
            }
            if (IsNewCount > 0)
            {
                --IsNewCount;
            }

            Draw(g);

            return(new ProcessResult()
            {
                IsDead = IsDead
            });
        }
コード例 #3
0
        /// <summary>
        /// ゲーム中の1フレームの処理を行います.これはステージ選択をした後からゲームクリア画面表示またはゲームオーバー画面表示が終わるまで実行されます.
        /// </summary>
        /// <param name="input">ユーザの現在の入力</param>
        /// <param name="g">グラフィックスオブジェクト</param>
        /// <param name="uc">ユーザが選択したバーの種類とステージの種類</param>
        /// <param name="takeOver">ユーザのスコアとストックおよびディスプレイ環境</param>
        /// <returns></returns>
        private bool GameFrameProcess(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            int brokenBlockCount = 0;

            //ブロックの描画処理
            builder.BlockProcess(input, g, uc, takeOver, blocks, ref brokenBlockCount, stageTotalBlockCount);

            if (input.AT)
            {
                SyncMainBallCXToBarCX();
            }

            //バーの処理
            bar.Process(input, g, uc, takeOver);

            ApplyBarAccelToBalls();

            UpdateMainBall(input, g);
            UpdateSmallBalls(input, g, uc, takeOver);

            //情報の表示
            DisplayInfo(g, mainBall.IsDead);

            ///音再生
            SoundPlay();

            CheckEnd(brokenBlockCount, mainBall.IsDead);

            return(mainBall.IsDead);
        }
コード例 #4
0
ファイル: BarSelect.cs プロジェクト: dhq-boiler/blockCrash
        public ProcessResult Process(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            //キー処理
            KeyGet(input);

            //描画処理
            Draw(g);

            if (IsDead)
            {
                uc.BarType = (EBarType)Bar;
                return(new ProcessResult()
                {
                    IsDead = IsDead,
                    NextState = new StageSelect(dInfo, Operator, uc),
                    UserChoice = uc,
                    TakeOver = takeOver
                });
            }
            else
            {
                return new ProcessResult()
                       {
                           IsDead    = IsDead,
                           NextState = this
                       }
            };
        }
コード例 #5
0
        public override void BlockProcess(Input input, Graphics g, UserChoice uc, TakeOver takeOver, Block[] block, ref int ballDeadCount, int sumblock)
        {
            for (int i = 0; i < sumblock; ++i)
            {
                if (block[i].IsDead)
                {
                    ++ballDeadCount;
                }

                if (i < 7)
                {
                    block[i].Process(input, g, uc, takeOver);
                }
                else if (i > 6 && i < 14)
                {
                    block[i].Process(input, g, uc, takeOver);
                }
                else if (i > 13 && i < 21)
                {
                    block[i].Process(input, g, uc, takeOver);
                }
                else
                {
                    block[i].Process(input, g, uc, takeOver);
                }
            }
        }
コード例 #6
0
ファイル: Message.cs プロジェクト: dhq-boiler/blockCrash
        public ProcessResult Process(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            //キー処理
            KeyGet(input);

            //描画処理
            Draw(g);

            return(new ProcessResult()
            {
                IsDead = IsDead
            });
        }
コード例 #7
0
ファイル: Block.cs プロジェクト: dhq-boiler/blockCrash
        public ProcessResult Process(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            CalculatePosition();

            Draw(g);

            if (matchlessCount > 0)
            {
                --matchlessCount;
            }

            return(new ProcessResult()
            {
                IsDead = IsDead
            });
        }
コード例 #8
0
ファイル: Main.cs プロジェクト: dhq-boiler/blockCrash
        public Main(DisplayInfo dInfo, WPFBlockCrash.BlockCrashView.EOperatingType OperatingType)
        {
            MainInstance       = this;
            this.dInfo         = dInfo;
            this.OperatingType = OperatingType;

            Reconstruct(dInfo, OperatingType);
            userChoice = new UserChoice();
            takeOver   = new TakeOver()
            {
                DisplayInfo = dInfo,
                Score       = 0,
                Stock       = 2
            };
            AutoModeControl = 0;
        }
コード例 #9
0
        public ProcessResult Process(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            if (!IsDead)
            {
                //キー処理
                if (!KeyGet(input))
                {
                    Accel             = 0;
                    AcceleratingCount = 0;
                }
            }

            //描画処理
            Draw(g);

            return(new ProcessResult()
            {
                IsDead = IsDead
            });
        }
コード例 #10
0
        public Control(UserChoice userChoice, TakeOver takeOver, DisplayInfo dInfo, Input input, IOperator Operator)
        {
            this.dInfo    = dInfo;
            this.Operator = Operator;

            BarType = userChoice.BarType;

            bool extendon = true;

            if (BarType == EBarType.SHORT)
            {
                extendon = false;
            }

            //バーとボールのインスタンスを生成
            bar              = new Bar(BarType, dInfo, Operator);
            mainBall         = new Ball(dInfo, bar);
            ballSpeedUpCount = 0;

            SmallBalls            = new LinkedList <Ball>();
            willBeAddedSmallBalls = new List <Ball>();

            cleared         = false;
            Score           = takeOver.Score;
            Stock           = takeOver.Stock;
            Stage           = userChoice.StageType;
            ramdomWalkCount = 0;
            ComboCount      = 0;
            OnCombo         = false;
            combooncount    = 0;
            alphacombo      = 0;

            PrepareSound();

            // 残機表示の読み込み
            gh = new Bitmap(Main.ResourceDirectory + "ball_b.png");

            builder = StageBuilder.CreateStageBuilder(Stage);

            builder.CreateStage(out blocks, ref stageTotalBlockCount, extendon);
        }
コード例 #11
0
        private void UpdateSmallBalls(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            List <Ball> willBeRemovedSmallBalls = new List <Ball>();

            foreach (Ball smallBall in SmallBalls)
            {
                bool SmallBallDroped = smallBall.Process(input, g, uc, takeOver).IsDead;

                if (SmallBallDroped)
                {
                    willBeRemovedSmallBalls.Add(smallBall);
                }
                else
                {
                    if (smallBall.IsCaught)                    // ボールが止まっていれば
                    {
                        //吸着時のスモールボールのX座標
                        smallBall.CenterX = bar.CenterX + smallBall.CatchXOffset;
                    }

                    HitCheckBallAndBar(smallBall, g);
                    HitCheckBallAndBlock(smallBall);
                    HitCheckBallAndBall(smallBall);
                }
            }

            foreach (Ball Adding in willBeAddedSmallBalls)
            {
                SmallBalls.AddLast(Adding);
            }

            foreach (Ball removing in willBeRemovedSmallBalls)
            {
                SmallBalls.Remove(removing);
            }

            willBeAddedSmallBalls.Clear();
            willBeRemovedSmallBalls.Clear();
        }
コード例 #12
0
        public ProcessResult Process(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            //キー処理
            KeyGet(input);

            //描画処理
            Draw(g);

            if (IsDead)
            {
                return new ProcessResult()
                       {
                           IsDead = IsDead, NextState = new Title(Main.MainInstance, dInfo, Operator)
                       }
            }
            ;
            else
            {
                return new ProcessResult()
                       {
                           IsDead = IsDead, NextState = this
                       }
            };
        }
コード例 #13
0
 public override void BlockProcess(Input input, System.Drawing.Graphics g, UserChoice uc, TakeOver takeOver, Block[] block, ref int ballDeadCount, int sumblock)
 {
     StageUtil.CommonBlockProcess(input, g, uc, takeOver, block, ref ballDeadCount, sumblock);
 }
コード例 #14
0
 abstract public void BlockProcess(Input input, Graphics g, UserChoice uc, TakeOver takeOver, Block[] block, ref int ballDeadCount, int sumblock);
コード例 #15
0
        public ProcessResult Process(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            if (GameFrameProcess(input, g, uc, takeOver))
            {
                if (Stock > 1)
                {
                    if (IsPlaying)
                    {
                        message         = new Message(EMessageType.FAILED, 50, dInfo);
                        IsPlaying       = false;
                        mainBall.IsStop = true;
                    }

                    if (message.Process(input, g, uc, takeOver).IsDead)
                    {
                        Reset();
                        --Stock;
                        IsPlaying = true;
                        message   = null;
                    }
                }
                else                 // Stock == 0
                {
                    if (IsPlaying)
                    {
                        message         = new Message(EMessageType.GAMEOVER, 120, dInfo);
                        IsPlaying       = false;
                        mainBall.IsStop = true;
                    }

                    if (message.Process(input, g, uc, takeOver).IsDead)
                    {
                        return(new ProcessResult()
                        {
                            IsDead = true,
                            NextState = new Ranking(Score, BarType, dInfo, Operator),
                            TakeOver = takeOver
                        });
                    }
                }
            }
            else if (cleared)
            {
                if (IsPlaying)
                {
                    message         = new Message(EMessageType.CLEAR, 200, dInfo);
                    IsPlaying       = false;
                    mainBall.IsStop = true;
                }

                if (message.Process(input, g, uc, takeOver).IsDead)
                {
                    if (input.AT)
                    {
                        return new ProcessResult()
                               {
                                   IsDead    = true,
                                   NextState = new Title(Main.MainInstance, dInfo, Operator),
                                   TakeOver  = takeOver
                               }
                    }
                    ;
                    else
                    {
                        return new ProcessResult()
                               {
                                   IsDead    = true,
                                   NextState = new Ranking(Score, BarType, dInfo, Operator),
                                   TakeOver  = takeOver
                               }
                    };
                }
            }

            return(new ProcessResult()
            {
                IsDead = false,
                NextState = this,
                TakeOver = takeOver,
                UserChoice = uc
            });
        }
コード例 #16
0
        public static void CommonBlockProcess(Input input, Graphics g, UserChoice uc, TakeOver takeOver, Block[] block, ref int ballDeadCount, int sumblock)
        {
            for (int i = 0; i < sumblock; ++i)
            {
                if (block[i].IsDead)
                {
                    ++ballDeadCount;
                }

                if (i % 4 == 0)
                {
                    block[i].Process(input, g, uc, takeOver);
                }
                else if (i % 4 == 1)
                {
                    block[i].Process(input, g, uc, takeOver);
                }
                else if (i % 4 == 2)
                {
                    block[i].Process(input, g, uc, takeOver);
                }
                else
                {
                    block[i].Process(input, g, uc, takeOver);
                }
            }
        }