예제 #1
0
        public TouchZone(TouchZone zone_)
        {
            // TouchZone constructor
            // ================

            SetMin(zone_.GetMin());
            SetMax(zone_.GetMax());
        }
예제 #2
0
        // TODO: Add relevant sprites with getters/setters for UI

        // Methods
        public ControlScheme(Quadrent quadrent_)
        {
            // ControlScheme constructor
            // ================

            m_quadrent = quadrent_;

            m_steeringValue = 0;
            m_braking       = false;

            m_steeringMaxDistance = 150;

            // Set touch zone
            switch (m_quadrent)
            {
            case Quadrent.TOP_LEFT:
                m_touchZone = new TouchZone(new Vector2(0, 0),
                                            new Vector2(Settings.m_screenWidth / 2, Settings.m_screenHeight / 2));
                break;

            case Quadrent.TOP_RIGHT:
                m_touchZone = new TouchZone(new Vector2(Settings.m_screenWidth / 2, 0),
                                            new Vector2(Settings.m_screenWidth, Settings.m_screenHeight / 2));
                break;

            case Quadrent.BOTTOM_LEFT:
                m_touchZone = new TouchZone(new Vector2(0, Settings.m_screenHeight / 2),
                                            new Vector2(Settings.m_screenWidth / 2, Settings.m_screenHeight));
                break;

            case Quadrent.BOTTOM_RIGHT:
                m_touchZone = new TouchZone(new Vector2(Settings.m_screenWidth / 2, Settings.m_screenHeight / 2),
                                            new Vector2(Settings.m_screenWidth, Settings.m_screenHeight));
                break;
            }
        }