Example #1
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);
                }
            }
        }
Example #2
0
        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
                       }
            };
        }
        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);
                }
            }
        }
Example #4
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
                       }
            };
        }
Example #5
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);
        }
Example #6
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
            });
        }
Example #7
0
        public ProcessResult Process(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            //キー処理
            KeyGet(input);

            //描画処理
            Draw(g);

            return(new ProcessResult()
            {
                IsDead = IsDead
            });
        }
Example #8
0
        public StageSelect(DisplayInfo dInfo, IOperator Operator, UserChoice uc)
        {
            this.dInfo    = dInfo;
            this.Operator = Operator;
            this.Bar      = uc.BarType;

            bargh     = new Image[3];
            stagegh   = new Image[6];
            sdetailgh = new Image[6];
            clear     = new bool[6];

            Stage = 1;

            bargh[0] = new Bitmap(Main.ResourceDirectory + "bar.bmp");
            bargh[1] = new Bitmap(Main.ResourceDirectory + "barsecond.bmp");
            bargh[2] = new Bitmap(Main.ResourceDirectory + "barthird.bmp");

            ballgh = new Bitmap(Main.ResourceDirectory + "ball_b.png");

            stagegh[0] = new Bitmap(Main.ResourceDirectory + "stage1mini.png");
            stagegh[1] = new Bitmap(Main.ResourceDirectory + "stage2mini.png");
            stagegh[2] = new Bitmap(Main.ResourceDirectory + "stage3mini.png");
            stagegh[3] = new Bitmap(Main.ResourceDirectory + "stage4mini.png");
            stagegh[4] = new Bitmap(Main.ResourceDirectory + "stage5mini.png");
            stagegh[5] = new Bitmap(Main.ResourceDirectory + "ball.png");

            sdetailgh[0] = new Bitmap(Main.ResourceDirectory + "stage1.png");
            sdetailgh[1] = new Bitmap(Main.ResourceDirectory + "stage2.png");
            sdetailgh[2] = new Bitmap(Main.ResourceDirectory + "stage3.png");
            sdetailgh[3] = new Bitmap(Main.ResourceDirectory + "stage4.png");
            sdetailgh[4] = new Bitmap(Main.ResourceDirectory + "stage5.png");
            sdetailgh[5] = new Bitmap(Main.ResourceDirectory + "ball.png");

            sselectgh = new Bitmap(Main.ResourceDirectory + "stageselect.png");
            cleargh   = new Bitmap(Main.ResourceDirectory + "clearstar.png");

            IsDead = false;

            for (int i = 0; i < 6; ++i)
            {
                clear[i] = false;
            }

            Score = 0;
#if DEBUG
            Stock = 10;
#else
            Stock = 2;
#endif
            autocount = 0;
        }
Example #9
0
        public ProcessResult Process(Input input, Graphics g, UserChoice uc, TakeOver takeOver)
        {
            CalculatePosition();

            Draw(g);

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

            return(new ProcessResult()
            {
                IsDead = IsDead
            });
        }
Example #10
0
        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;
        }
Example #11
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
            });
        }
Example #12
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);
        }
Example #13
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();
        }
Example #14
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
                       }
            };
        }
 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);
 }
Example #16
0
 abstract public void BlockProcess(Input input, Graphics g, UserChoice uc, TakeOver takeOver, Block[] block, ref int ballDeadCount, int sumblock);
Example #17
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
            });
        }