亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? snakecontrol.vb

?? VB.net貪吃蛇
?? VB
字號:
Option Strict On
Option Explicit On 

' *******************  SnakeDotNet  *******************
'       File:       SnakeControl.vb
'       Version:    1.0
'       Author:     Tim Overbay
'       Date:       June 27, 2002

Namespace SnakeDotNet

    ' This class is used to control the movement of the snake
    ' - The snake can move in four directions: Up, Down, Right, & Left
    ' - The snake cannot reverse direction (i.e. Up to Down, Right to Left)
    ' - The snake's position is defined as the location of its head.
    ' - The snake is moved by incrementing it's position in the current direction
    '   by the amount specified by the width of a node.

    Public Class SnakeControl

        ' SnakeDirection enumerates the possible
        ' directions the snake can move.
        Friend Enum SnakeDirection As Integer
            None = -1
            Left            ' 0     X -= increment
            Down            ' 1     Y += increment
            Right           ' 2     X += increment
            Up              ' 3     Y -= increment
        End Enum

        Private m_location As Point                 ' Current location of the head
        Private m_increment As Integer              ' Increment used to move the snake
        Private m_direction As SnakeDirection       ' Current direction of movement

        ' Default constructor
        Public Sub New()
            m_increment = 8                         ' Default movement increment
            m_location = New Point(0, 0)            ' Default starting location
            Direction = SnakeDirection.Right         ' Default direction
        End Sub

        ' Parametricized constructor where the increment,
        ' starting position, & direction are specified.
        Friend Sub New(ByVal newIncrement As Integer, ByVal startLocation As Point, ByVal newDirection As SnakeDirection)
            ' Check that the new direction is valid
            If (newDirection < SnakeDirection.Left) OrElse (newDirection > SnakeDirection.Up) Then
                Throw New ArgumentOutOfRangeException("Direction", "Direction must be Left [0], Down [1], Right [2], or Up [3]")
                Return
            End If
            ' Set the new direction
            m_direction = newDirection
            ' Set the new increment value
            m_increment = newIncrement
            ' Set the starting location
            m_location = startLocation
        End Sub

        ' Look ahead to the snake's next location without actually moving the snake there.
        ' The optional peekDir parameter allows the caller to peek in a direction
        ' other than the current direction.
        Friend Function PeekNextLocation(Optional ByVal peekDir As SnakeDirection = SnakeDirection.None) As Point
            ' Make a temporary copy of the snake's current location
            Dim retpt As New Point(m_location.X, m_location.Y)

            ' Check for default value. Set peekDir to the snake's current direction.
            If (peekDir = SnakeDirection.None) Then peekDir = m_direction

            ' Increment the temporary location based on the specified direction
            Select Case peekDir
                Case SnakeDirection.Left
                    retpt.X -= m_increment
                    Exit Select
                Case SnakeDirection.Down
                    retpt.Y += m_increment
                    Exit Select
                Case SnakeDirection.Right
                    retpt.X += m_increment
                    Exit Select
                Case SnakeDirection.Up
                    retpt.Y -= m_increment
                    Exit Select
            End Select

            ' Return the new location
            Return retpt
        End Function

        ' Move's the snake to the next location based on the snake's current direction.
        ' The optional moveDir parameter allows the caller to move the snake in a direction
        ' other than the current direction.
        Friend Sub Move(Optional ByVal moveDir As SnakeDirection = SnakeDirection.None)

            ' Check for default value. Set moveDir to the snake's current direction.
            If (moveDir = SnakeDirection.None) Then moveDir = m_direction

            ' Increment the snake's location based on the specified direction
            ' and set the Shape appropriately.
            Select Case moveDir
                Case SnakeDirection.Left
                    m_location.X -= m_increment
                    Exit Select
                Case SnakeDirection.Down
                    m_location.Y += m_increment
                    Exit Select
                Case SnakeDirection.Right
                    m_location.X += m_increment
                    Exit Select
                Case SnakeDirection.Up
                    m_location.Y -= m_increment
                    Exit Select
            End Select
        End Sub

        ' This is a special version of the Move that allows the
        ' controller to "wrap around" the specified bounds.
        Friend Sub Move(ByVal bounds As Rectangle, Optional ByVal moveDir As SnakeDirection = SnakeDirection.None)
            Move(moveDir)

            If (m_location.X > bounds.Right) Then
                m_location.X = CInt(bounds.Left / m_increment) * m_increment
            ElseIf (m_location.X < bounds.Left) Then
                m_location.X = CInt(bounds.Right / m_increment) * m_increment
            ElseIf (m_location.Y > bounds.Bottom) Then
                m_location.Y = CInt(bounds.Top / m_increment) * m_increment
            ElseIf (m_location.Y < bounds.Top) Then
                m_location.Y = CInt(bounds.Bottom / m_increment) * m_increment
            End If
        End Sub

        ' Returns the current position of the snake's head
        Public ReadOnly Property Location() As Point
            Get
                Return m_location
            End Get
        End Property

        ' Sets/Returns the snake's current direction
        Friend Property Direction() As SnakeDirection
            Get
                Return m_direction
            End Get

            Set(ByVal newDirection As SnakeDirection)

                ' Check that the new direction is valid
                If (newDirection < SnakeDirection.Left) OrElse (newDirection > SnakeDirection.Up) Then
                    Throw New ArgumentOutOfRangeException("Direction", "Direction must be Left [0], Down [1], Right [2], or Up [3]")
                    Return
                End If

                ' Check if direction hasn't changed
                If newDirection = m_direction Then Exit Property

                ' Check if direction is reversed
                If CInt(Math.Abs(newDirection - m_direction) Mod 2) = 0 Then Exit Property

                ' Finally, change the snake's direction
                m_direction = newDirection

            End Set
        End Property

        ' Function to rotate the snake's direction 90 degrees counter-clockwise.
        Public Sub TurnLeft()

            ' Check that the snake's current direction is valid.
            If (m_direction < SnakeDirection.Left) Or (m_direction > SnakeDirection.Up) Then Exit Sub

            ' Get the new direction
            Dim newdir As SnakeDirection = CType(m_direction + 1, SnakeDirection)

            ' Wrap it around back to Left, if necessary.
            If newdir > SnakeDirection.Up Then newdir = SnakeDirection.Left

            ' Set the snake's new direction
            Direction = newdir

        End Sub

        ' Function to rotate the snake's direction 90 degrees clockwise.
        Public Sub TurnRight()

            ' Check that the snake's current direction is valid.
            If (m_direction < SnakeDirection.Left) Or (m_direction > SnakeDirection.Up) Then Exit Sub

            ' Get the new direction
            Dim newdir As SnakeDirection = CType(m_direction - 1, SnakeDirection)

            ' Wrap it around back to Up, if necessary.
            If newdir < SnakeDirection.Left Then newdir = SnakeDirection.Up

            ' Set the snake's new direction
            Direction = newdir

        End Sub

        ' Returns the snake's increment value.
        ' NOTE: This property is currently read-only. It might be more
        '       useful to make it read/write.
        Public ReadOnly Property Increment() As Integer
            Get
                Return m_increment
            End Get
        End Property

    End Class

End Namespace

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲天堂a在线| 国产成人免费视频| 国产曰批免费观看久久久| 97精品久久久午夜一区二区三区| 欧美一区二区三区四区五区 | 国产精品嫩草99a| 日韩av电影天堂| 一本大道久久a久久精品综合| 久久综合国产精品| 蜜臀av在线播放一区二区三区 | 在线亚洲一区二区| 国产性色一区二区| 久久99精品久久久久久国产越南| 欧美视频在线一区| 一区二区三区在线播放| 亚洲影院免费观看| 一区二区三区在线观看视频| 精品一区二区国语对白| 欧美性做爰猛烈叫床潮| 中文字幕一区av| 不卡一区在线观看| 国产欧美日韩三区| 国产sm精品调教视频网站| 久久午夜电影网| 国内精品国产三级国产a久久| 在线综合亚洲欧美在线视频| 亚洲第一搞黄网站| 欧美日韩你懂的| 亚洲国产综合视频在线观看| 91在线国内视频| √…a在线天堂一区| 成人av综合一区| 日韩美女精品在线| 91在线观看成人| 一区二区三区中文字幕| 在线国产电影不卡| 五月天欧美精品| 欧美一区二区日韩| 激情丁香综合五月| 亚洲国产精品黑人久久久| 国产呦萝稀缺另类资源| 国产亚洲制服色| 99天天综合性| 一区二区日韩电影| 欧美精品乱码久久久久久按摩| 亚洲国产精品久久久久秋霞影院| 欧美在线三级电影| 奇米影视7777精品一区二区| 日韩小视频在线观看专区| 欧美在线你懂得| 青娱乐精品在线视频| 日韩一区二区三区av| 国产盗摄一区二区| 伊人开心综合网| 日韩欧美一二区| 成人美女视频在线看| 亚洲国产人成综合网站| 日韩一区二区电影网| 成人亚洲一区二区一| 亚洲国产精品久久久男人的天堂| 欧美大胆人体bbbb| 成人国产精品免费网站| 性做久久久久久免费观看| 2024国产精品| 在线观看欧美精品| 精品一区二区三区的国产在线播放| 久久久精品一品道一区| 色88888久久久久久影院野外| 日韩av一区二区三区| 国产精品午夜久久| 91精品久久久久久久99蜜桃| 高清不卡一区二区在线| 一区二区三区在线高清| 久久综合狠狠综合久久激情| 日本丶国产丶欧美色综合| 精品一二线国产| 一区二区三区欧美视频| 亚洲国产中文字幕| 国产午夜精品一区二区三区四区| 一本大道av伊人久久综合| 韩国成人精品a∨在线观看| 亚洲综合精品久久| 国产精品伦理在线| 精品理论电影在线观看 | 亚洲综合免费观看高清完整版在线| 制服丝袜亚洲色图| 91麻豆高清视频| 丰满少妇在线播放bd日韩电影| 亚洲国产精品久久久久婷婷884 | 日韩片之四级片| 色天使色偷偷av一区二区| 狠狠网亚洲精品| 奇米色一区二区| 亚洲成人一区二区在线观看| 中文字幕中文字幕一区| 久久精品夜夜夜夜久久| 欧美一区二区国产| 欧美美女视频在线观看| 99久久婷婷国产精品综合| 国产aⅴ综合色| 国产精一品亚洲二区在线视频| 日韩国产欧美视频| 亚洲成人免费观看| 一区二区三区免费在线观看| 国产精品久久毛片| 国产精品无遮挡| 国产精品美女www爽爽爽| 久久亚洲综合av| 精品对白一区国产伦| 欧美大黄免费观看| 久久色成人在线| 2023国产精品视频| 久久久精品免费网站| 久久久综合网站| 久久精品亚洲国产奇米99 | 91精品久久久久久久99蜜桃| 欧美影院午夜播放| 欧美视频中文一区二区三区在线观看| 91香蕉视频黄| 在线观看亚洲成人| 欧美日韩www| 日韩欧美在线一区二区三区| 日韩精品中午字幕| 久久夜色精品一区| 国产精品福利一区| 亚洲激情图片一区| 性欧美大战久久久久久久久| 奇米综合一区二区三区精品视频| 久草在线在线精品观看| 国产精品一区不卡| av一区二区三区黑人| 在线精品视频免费观看| 91精品国产一区二区三区香蕉| 欧美一区二区三区系列电影| 精品成人佐山爱一区二区| 国产精品私人影院| 一区二区三区四区亚洲| 日本亚洲欧美天堂免费| 国产在线观看免费一区| 色综合视频在线观看| 欧美夫妻性生活| 国产欧美一区二区在线观看| 亚洲免费观看在线观看| 日本成人在线电影网| 国产精品一区一区三区| 色偷偷88欧美精品久久久| 欧美一卡二卡三卡| 国产精品沙发午睡系列990531| 一区二区三区欧美日韩| 久久av中文字幕片| 97久久精品人人爽人人爽蜜臀| 欧美精品亚洲一区二区在线播放| 26uuuu精品一区二区| 亚洲主播在线播放| 国产一区日韩二区欧美三区| 91福利视频在线| 久久久国产综合精品女国产盗摄| 一区二区三区国产| 国产精品性做久久久久久| 欧美亚洲高清一区| 欧美极品少妇xxxxⅹ高跟鞋| 午夜影院久久久| gogo大胆日本视频一区| 91精品国产一区二区| 亚洲欧洲国产日本综合| 精品一区在线看| 欧美日韩国产成人在线免费| 中文一区在线播放 | 午夜电影久久久| 不卡高清视频专区| 精品免费国产一区二区三区四区| 亚洲一卡二卡三卡四卡无卡久久| 国产精品一二二区| 日韩欧美高清在线| 亚洲国产你懂的| 91视频在线观看| 国产婷婷色一区二区三区四区| 日韩av网站在线观看| 在线日韩一区二区| 亚洲欧美色综合| 成人黄色av电影| 久久久不卡网国产精品二区| 日本欧美一区二区| 欧美日韩国产综合视频在线观看| 国产精品久久久久久久久快鸭 | 久久久久久毛片| 久久精品国产999大香线蕉| 欧美日韩电影在线播放| 综合在线观看色| 99免费精品在线| 国产精品免费av| 白白色 亚洲乱淫| 中文字幕永久在线不卡| 国产福利一区在线观看| 国产午夜久久久久| 国产成人av影院| 亚洲国产电影在线观看| 成人午夜视频网站| 亚洲欧洲成人自拍| 95精品视频在线|