declares.bas

来自「VB编的小游戏」· BAS 代码 · 共 75 行

BAS
75 行
字号
Attribute VB_Name = "Declares"
Public Declare Function SleepEx Lib "kernel32" (ByVal dwMilliseconds As Long, ByVal bAlertable As Long) As Long
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Const SND_LOOP = &H8
Const SND_NOSTOP = &H10
Public Type Game
    Playerss As Byte
    P1_Name As String
    P2_Name As String
    P1_Score As Double
    P2_Score As Double
    Curplayer As Byte
    CurrentChoice1 As Byte
    CurrentChoice2 As Byte
    FirstChoice As Integer
    SecondChoice As Integer
End Type

Public MyGame As Game
Public Sounds As Byte
Public Level As Byte
Public Players As Integer
Public Animation As Boolean
Public MainPath As String
Public SoundPath As String
Public Chrsep As String
Public Score As Long
Public Reveal As Byte
Public p2gametype As Byte

Public doigetGood As Integer
Public vaval As Integer
Public iv As Integer
Public pp As Boolean
Public op As String
Public vvv As Integer
Public eog As Integer
Public ef As Boolean
Public vvv1 As Integer
Public selcard As Integer

Public skill As Byte
Public skl As String
Public TTL As String
Public GameInProgress As Boolean
Public Paused As Boolean
Public ShowTabs As Boolean

Public Const NormWidth = 8175
Public Const NormHeight = 5910
Public Const ChatHeight = 7000
Public Const ChatWidth = 8175

Public Sub PlaySound(File As String)
    Flg = SND_ASYNC
    sndPlaySound File, Flg
End Sub


Public Function Parse(ByVal strString As String, lItemNum As Long) As String

    Dim arrItems() As String
    lItemNum = lItemNum - 1
    arrItems = Split(strString, Chrsep, , vbTextCompare)
    If lItemNum <= UBound(arrItems) Then
        Parse = arrItems(lItemNum)
    End If
    Erase arrItems
End Function

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?