コード例 #1
0
        public override void Draw2()
        {
            spriteBatch.Draw(SK.texture_background_sudoku, SK.Position_Sudoku_Grid(), Color.White);
            for (int y = 0; y < 9; y++)
            {
                for (int x = 0; x < 9; x++)
                {
                    if (grid_mirror[x, y] != 0)
                    {
                        if (grid[x, y] != 0)
                        {
                            spriteBatch.Draw(SK.texture_spritesheet_sudoku, SK.Position_Sudoku_Grid() + new Vector2(x * 64, y * 64), new Rectangle(1 + Get_Number(true, grid[x, y]) * 65, 1 + Get_Number(false, grid[x, y]) * 65, 64, 64), Color.Black, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                        }
                    }
                    else
                    {
                        if (grid[x, y] != 0)
                        {
                            spriteBatch.Draw(SK.texture_spritesheet_sudoku, SK.Position_Sudoku_Grid() + new Vector2(x * 64, y * 64), new Rectangle(1 + Get_Number(true, grid[x, y]) * 65, 1 + Get_Number(false, grid[x, y]) * 65, 64, 64), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                        }
                    }
                }
            }

            if (active_selection)
            {
                spriteBatch.Draw(SK.texture_spritesheet_minos_64x, SK.Position_Sudoku_Grid() + new Vector2(selector_grid.X * 64, selector_grid.Y * 64), new Rectangle(0, 0, 64, 64), Color.Azure * 1.00f);
            }
            else
            {
                spriteBatch.Draw(SK.texture_spritesheet_minos_64x, SK.Position_Sudoku_Grid() + new Vector2(selector_grid.X * 64, selector_grid.Y * 64), null, Color.Azure * 0.50f);
            }

            for (int x = 0; x < 9; x++)
            {
                spriteBatch.Draw(SK.texture_spritesheet_sudoku, SK.Position_Sudoku_Selection() + new Vector2(x * 64, 0), new Rectangle(1 + Get_Number(true, x + 1) * 65, 1 + Get_Number(false, x + 1) * 65, 64, 64), Color.White);
            }
            if (active_selection)
            {
                spriteBatch.Draw(SK.texture_spritesheet_minos_64x, SK.Position_Sudoku_Selection() + new Vector2(selector_number * 64, 0), new Rectangle(0, 0, 64, 64), Color.Blue * 0.50f);
            }
        }
コード例 #2
0
 public override string Update2()
 {
     if (ButtonPressed(GhostKey.button_function_P1) == GhostState.pressed)
     {
         if (!active_gameover)
         {
             pressed_response = true;
         }
     }
     if (ButtonPressed(GhostKey.button_ok_P1) == GhostState.pressed)
     {
         if (active_selection)
         {
             Insert();
         }
         else
         {
             Select();
         } pressed_response = true;
     }
     if (ButtonPressed(GhostKey.arrow_up_P1) == GhostState.pressed)
     {
         if (!active_selection)
         {
             if (selector_grid.Y > 0)
             {
                 selector_grid.Y--;
             }
         }
         else
         {
         } pressed_response = true;
     }
     if (ButtonPressed(GhostKey.arrow_down_P1) == GhostState.pressed)
     {
         if (!active_selection)
         {
             if (selector_grid.Y < 8)
             {
                 selector_grid.Y++;
             }
         }
         else
         {
         } pressed_response = true;
     }
     if (ButtonPressed(GhostKey.arrow_left_P1) == GhostState.pressed)
     {
         if (!active_selection)
         {
             if (selector_grid.X > 0)
             {
                 selector_grid.X--;
             }
         }
         else
         {
             if (selector_number > 0)
             {
                 selector_number--;
             }
         } pressed_response = true;
     }
     if (ButtonPressed(GhostKey.arrow_right_P1) == GhostState.pressed)
     {
         if (!active_selection)
         {
             if (selector_grid.X < 8)
             {
                 selector_grid.X++;
             }
         }
         else
         {
             if (selector_number < 8)
             {
                 selector_number++;
             }
         } pressed_response = true;
     }
     if (pressed_event_touch)
     {
         pressed_response = true;
         for (int y = 0; y < 9; y++)
         {
             for (int x = 0; x < 9; x++)
             {
                 if (Collision_Button(false, new Rectangle((int)SK.Position_Sudoku_Grid().X + 64 * x, (int)SK.Position_Sudoku_Grid().Y + 64 * y, 64, 64)))
                 {
                     if (selector_grid == new Vector2(x, y))
                     {
                         if (!active_selection)
                         {
                             Select();
                         }
                     }
                     else
                     {
                         selector_grid = new Vector2(x, y);
                     }
                 }
             }
         }
         for (int x = 0; x < 9; x++)
         {
             if (Collision_Button(false, new Rectangle((int)SK.Position_Sudoku_Selection().X + 64 * x, (int)SK.Position_Sudoku_Selection().Y, 64, 64)))
             {
                 if (selector_number == x)
                 {
                     if (active_selection)
                     {
                         Insert();
                     }
                 }
                 else
                 {
                     selector_number = x;
                 }
             }
         }
     }
     for (int y = 0; y < 9; y++)
     {
         for (int x = 0; x < 9; x++)
         {
             if (Collision_Button(true, new Rectangle((int)SK.Position_Sudoku_Grid().X + 64 * x, (int)SK.Position_Sudoku_Grid().Y + 64 * y, 64, 64)))
             {
                 if (!active_selection)
                 {
                     selector_grid = new Vector2(x, y);
                 }
             }
         }
     }
     for (int x = 0; x < 9; x++)
     {
         if (Collision_Button(true, new Rectangle((int)SK.Position_Sudoku_Selection().X + 64 * x, (int)SK.Position_Sudoku_Selection().Y, 64, 64)))
         {
             if (active_selection)
             {
                 selector_number = x;
             }
         }
     }
     return("null");
 }