Ejemplo n.º 1
0
 public GameStage(Game game, GraphicsDeviceManager graphics, GameScene owner)
 {
     this.game = game;
     this.graphics = graphics;
     this.content = game.Content;
     this.owner = owner;
     this.nowGameMainState = GameMainState.TargetRock;
     this.prevGameMainState = this.nowGameMainState;
     this.stagePlayer = new PlayerObject(owner, Color.White, new Rectangle(680, 430, 96, 150), "lwbg_player_normal");
     this.randomObject = new System.Random();
     this.stageUiList = new Dictionary<string, GameObject>();
 }
Ejemplo n.º 2
0
        public GameResponseViewModel Response(int id, GameMainState gameState, GameResponseViewModel response)
        {
            if (response == null)
            {
                throw new HttpResponseException(System.Net.HttpStatusCode.BadRequest);
            }
            switch (gameState)
            {
            case GameMainState.Questionnaire:
                return(new GameResponseViewModel
                {
                    GameMainState = new GameMainStateViewModel
                    {
                        CurrentState = GameMainState.Board,
                        Id = 2,
                        Name = "It is your turn.",
                        Url = string.Format("/api/game/reponse?id={0}&state={1}", id, GameMainState.Board)
                    }
                });

            case GameMainState.Board:
                return(new GameResponseViewModel
                {
                    GameMainState = new GameMainStateViewModel
                    {
                        CurrentState = GameMainState.Board,
                        Id = 3,
                        Name = "Wait for your oponent.",
                        Url = string.Format("/api/game/reponse?id={0}&state={1}", id, GameMainState.Board)
                    }
                });

            case GameMainState.Init:
                return(new GameResponseViewModel
                {
                    GameMainState = new GameMainStateViewModel
                    {
                        CurrentState = GameMainState.Questionnaire,
                        Id = 1,
                        Name = "Game preparation",
                        Url = string.Format("/api/game/reponse?id={0}&state={1}", id, GameMainState.Questionnaire)
                    }
                });

            default: throw new HttpResponseException(System.Net.HttpStatusCode.BadRequest);
            }
        }
Ejemplo n.º 3
0
 public MainScene(Game game, GraphicsDeviceManager graphics, SpriteBatch spriteBatch, SceneManager owner)
     : base(game, graphics, spriteBatch, owner)
 {
     this.game = game;
     this.graphics = graphics;
     this.content = game.Content;
     this.spriteBatch = spriteBatch;
     this.owner = owner;
     this.param = new Parameter();
     this.nowGameMainState = GameMainState.TargetRock;
     this.prevGameMainState = this.nowGameMainState;
     this.stageManager = new StageManager(this.game, this.graphics, this);
     this.nowStageNumber = 1;
     this.clearScore = 0;
     this.nowSelectStageMode = StageModeState.Normal;
     this.modeClearNumberList = new Dictionary<string, int>();
 }
Ejemplo n.º 4
0
 public void Update(GameMainState gameMainState, StageResult stageResult)
 {
     foreach (KeyValuePair<int, EnemyBase> enemyObject in this.stageEnemyList)
     {
         enemyObject.Value.Update(gameMainState);
     }
 }
Ejemplo n.º 5
0
 public virtual void Update(GameMainState gamestate)
 {
 }
Ejemplo n.º 6
0
        public void Update(GameTime gametime)
        {
            // ゲームの終了条件をチェックします。
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.game.Exit();
            this.prevGameMainState = this.nowGameMainState;

            int beforeKey = this.stagePlayer.stageSelectUfoKey;
            this.stageEnemyManager.Update(nowGameMainState, this.stagePlayer.PlayerStageResult);

            this.nowGameMainState = this.stagePlayer.resultGameState;
            this.getUfoKeyCheck();
            if (this.stagePlayer.stageSelectUfoKey != -1 && this.stagePlayer.stageSelectUfoKey < this.ufoKeyList.Length && this.ufoKeyList[this.stagePlayer.stageSelectUfoKey] != -1)
            {
                this.stagePlayer.UfoListSelectPos = this.stageEnemyManager.getUfoPos(this.ufoKeyList[this.stagePlayer.stageSelectUfoKey], this.ufoTargetPartsNumber);
            }
            else if (this.stagePlayer.stageSelectUfoKey >= this.ufoKeyList.Length)
            {
                for (int checkcount = 0; checkcount < ufoKeyList.Length; checkcount++)
                {
                    if (this.ufoKeyList[checkcount] != -1)
                    {
                        this.stagePlayer.stageSelectUfoKey = this.ufoKeyList[checkcount];
                        this.stagePlayer.UfoListSelectPos = this.stageEnemyManager.getUfoPos(this.ufoKeyList[this.stagePlayer.stageSelectUfoKey], this.ufoTargetPartsNumber);
                        break;
                    }
                }

            }
            else if (this.stagePlayer.stageSelectUfoKey == -1 || this.ufoKeyList[this.stagePlayer.stageSelectUfoKey] == -1)
            {
                for (int checkcount = ufoKeyList.Length - 1; checkcount > -1; checkcount--)
                {
                    if (this.ufoKeyList[checkcount] != -1)
                    {
                        this.stagePlayer.stageSelectUfoKey = this.ufoKeyList[checkcount];
                        this.stagePlayer.UfoListSelectPos = this.stageEnemyManager.getUfoPos(this.ufoKeyList[this.stagePlayer.stageSelectUfoKey], this.ufoTargetPartsNumber);
                        break;
                    }
                }

            }
        }
Ejemplo n.º 7
0
        private void targetRockTurn(int ufoCoolTime)
        {
            if (this.nowGameState == GameMainState.TargetRock && Input.GetKeyState(Keys.Z) == KeyResultState.PushedNow && ufoCoolTime > 20)
            {
                this.nowGameState = GameMainState.BallStart;
                this.battingHitTime = 0;
                this.swingTime = 0;
            }

            if (this.nowGameState == GameMainState.TargetRock)
            {

                if (Input.GetKeyState(Keys.Up) == KeyResultState.PushedNow)
                {
                    this.stageSelectUfoKey--;
                }

                if (Input.GetKeyState(Keys.Down) == KeyResultState.PushedNow)
                {
                    this.stageSelectUfoKey++;
                }
            }
        }
Ejemplo n.º 8
0
 private void buttingResult()
 {
     if (this.nowGameState == GameMainState.BallStart)
     {
         this.swingTime++;
         if (Input.GetKeyState(Keys.Z) == KeyResultState.PushedNow && swingTime > 5)
         {
             this.nowGameState = GameMainState.BallAction;
             this.nowBateerState = PlayerActionState.Swing;
             this.swingTime = 0;
         }
     }
 }
Ejemplo n.º 9
0
 public void Update(GameMainState gameMainState, int ufoCoolTime)
 {
     this.nowGameState = gameMainState;
     if (this.nowStageResult == StageResult.Playing)
     {
         this.targetRockTurn(ufoCoolTime);
         this.buttingResult();
         this.buttingSwing();
     }
     this.stageCheckResult();
     this.swingUpdate();
     this.stageResultUpdate();
     this.drawKeyword = this.actionList[this.nowBateerState];
     base.Update(gameMainState);
 }
Ejemplo n.º 10
0
 public override void Update(GameMainState gameMainState)
 {
     this.position.X += this.moveSpeed.X;
     this.position.Y += this.moveSpeed.Y;
     base.Update(gameMainState);
 }