コード例 #1
0
        public override void Draw2()
        {
            spriteBatch.Draw(SK.texture_static_simon_red, SK.Position_Simon(), Get_Color(0));
            spriteBatch.Draw(SK.texture_static_simon_blue, SK.Position_Simon(), Get_Color(1));
            spriteBatch.Draw(SK.texture_static_simon_green, SK.Position_Simon(), Get_Color(2));
            spriteBatch.Draw(SK.texture_static_simon_yellow, SK.Position_Simon(), Get_Color(3));

            spriteBatch.Draw(SK.texture_static_simon_console, SK.Position_Simon(), Color.White);

            int index = 0;

            foreach (int c in color_player)
            {
                spriteBatch.Draw(SK.texture_spritesheet_minos_32x, new Vector2(SK.Position_Simon_Player().X, SK.Position_DisplayEdge().Y + 10 + 35 * index), Get_Mino(c), Color.White);
                index++;
            }

            index = 0;

            foreach (int c in color_simon)
            {
                if (result)
                {
                    spriteBatch.Draw(SK.texture_spritesheet_minos_32x, new Vector2(SK.Position_Simon_Simon().X, SK.Position_DisplayEdge().Y + 10 + 35 * index), Get_Mino(c), Color.White);
                }
                else
                {
                    spriteBatch.Draw(SK.texture_spritesheet_minos_32x, new Vector2(SK.Position_Simon_Simon().X, SK.Position_DisplayEdge().Y + 10 + 35 * index), Get_Mino(-1), Color.White);
                }
                index++;
            }
        }
コード例 #2
0
        public override string Update2()
        {
            if (ButtonPressed(GhostKey.button_function_P1) == GhostState.pressed)
            {
                pressed_response = true;
            }
            if (ButtonPressed(GhostKey.button_ok_P1) == GhostState.pressed)
            {
                pressed_response = true;
            }
            if (ButtonPressed(GhostKey.arrow_up_P1) == GhostState.pressed)
            {
                if (active_player)
                {
                    Command_Arrow(0);
                }
                pressed_response = true;
            }
            if (ButtonPressed(GhostKey.arrow_down_P1) == GhostState.pressed)
            {
                if (active_player)
                {
                    Command_Arrow(3);
                }
                pressed_response = true;
            }
            if (ButtonPressed(GhostKey.arrow_left_P1) == GhostState.pressed)
            {
                if (active_player)
                {
                    Command_Arrow(1);
                }
                pressed_response = true;
            }
            if (ButtonPressed(GhostKey.arrow_right_P1) == GhostState.pressed)
            {
                if (active_player)
                {
                    Command_Arrow(2);
                }
                pressed_response = true;
            }

            if (pressed_event_touch)
            {
                if (Collision_Button(false, new Rectangle((int)SK.Position_Simon().X, (int)SK.Position_Simon().Y, 500, 500)))
                {
                    pressed_response = true;
                    int   x    = (int)control_cursor.X - (int)SK.Position_Simon().X;
                    int   y    = (int)control_cursor.Y - (int)SK.Position_Simon().Y;
                    Color temp = TextureData[500 * y + x];
                    if (temp == new Color(new Vector4(255, 0, 0, 255)))
                    {
                        Command_Arrow(0); // UP
                    }
                    else if (temp == new Color(new Vector4(0, 255, 0, 255)))
                    {
                        Command_Arrow(3); // DOWN
                    }
                    else if (temp == new Color(new Vector4(255, 0, 255, 255)))
                    {
                        Command_Arrow(1); // LEFT
                    }
                    else if (temp == new Color(new Vector4(0, 255, 255, 255)))
                    {
                        Command_Arrow(2); // RIGHT
                    }
                }
            }
            return("null");
        }