images.bas

来自「吃豆子游戏的源代码。 嘿嘿」· BAS 代码 · 共 89 行

BAS
89
字号
Attribute VB_Name = "Images"
Dim LoadTimes As Integer ' the number of pictures loaded so far
Public Sub LoadPic(Obj As Object, Pic As String, Optional pArray As Integer = 999, Optional SubDir As String = "")
 If Not Trim(SubDir) = "" Then SubDir = SubDir & "\" 'if a sub dir was given then add a backslash on the end
 If pArray = 999 Then ' if no array was given
  Obj.Picture = LoadPicture(App.Path & "\images\" & SubDir & Pic & ".img") 'load the picture into the image object
 Else ' there is an array
  Obj(pArray).Picture = LoadPicture(App.Path & "\images\" & SubDir & "\" & Pic & ".img") 'load the picture into the array object
 End If
 LoadTimes = LoadTimes + 1 'add to the amount of pictures loaded
 LoadingForm.UpdPer LoadTimes, 70 'update the loading form percentage.
End Sub
Public Sub LoadAllImages() 'loads all the images into the game
  LoadingForm.Visible = True 'show the loading form
  LoadingForm.Refresh
  
  With MainFrm
   
   LoadingForm.Info.Caption = "Loading...User Controls" 'set the loading form info
    .DrunkBar.LoadUserPicDRUNK   '-----load the pictures
    .ShieldBar.LoadUserPicSHIELD '----^
    .Play.LoadUserPic            '---^
    .ExitPacman.LoadUserPic      '--^
    .LevEdit.LoadUserPic         '-^
    .ContinueBttn.LoadUserPic    '^
   
   LoadingForm.Info.Caption = "Loading...Level Schemes" 'set the loading form info
    LoadPic .SpaceFood, "spacefood", , "schemes" 'load the picture
    LoadPic .ChocolateFood, "chocolatefood", , "schemes"
    LoadPic .MetalFood, "metalfood", , "schemes"
    LoadPic .ChristmasFood, "christmasfood", , "schemes"
    LoadPic .SkyFood, "skyfood", , "schemes"
    LoadPic .StdFood, "stdfood", , "schemes"
    LoadPic .SpaceBack, "spaceback", , "schemes"
    LoadPic .ChocolateBack, "chocolateback", , "schemes"
    LoadPic .MetalBack, "metalback", , "schemes"
    LoadPic .ChristmasBack, "christmasback", , "schemes"
    LoadPic .SkyBack, "skyback", , "schemes"
    LoadPic .StdBack, "stdback", , "schemes"
    LoadPic .SpaceWall, "spacewall", 0, "schemes"
    LoadPic .SpaceWall, "spacewall2", 1, "schemes"
    LoadPic .ChocolateWall, "chocolatewall", 0, "schemes"
    LoadPic .MetalWall, "metalwall", 0, "schemes"
    LoadPic .MetalWall, "metalwall2", 1, "schemes"
    LoadPic .ChristmasWall, "christmaswall", 0, "schemes"
    LoadPic .ChristmasWall, "christmaswall2", 1, "schemes"
    LoadPic .SkyWall, "skywall", 0, "schemes"
    LoadPic .StdWall, "stdwall", 0, "schemes"
   
   LoadingForm.Info.Caption = "Loading...Pacman"
    LoadPic .PacUp, "pacup", 0, "sprites"
    LoadPic .PacUp, "pacupclosed", 1, "sprites"
    LoadPic .PacDown, "pacdn", 0, "sprites"
    LoadPic .PacDown, "pacdnclosed", 1, "sprites"
    LoadPic .PacLeft, "pacleft", 0, "sprites"
    LoadPic .PacLeft, "pacleftclosed", 1, "sprites"
    LoadPic .PacRight, "pacright", 0, "sprites"
    LoadPic .PacRight, "pacrightclosed", 1, "sprites"
    LoadPic .LifeImg, "pacright", , "sprites"
    LoadPic .DeadImg, "skull", , "sprites"
    
   LoadingForm.Info.Caption = "Loading...Ghosts"
    LoadPic .GhoulPic, "ghoul1", 1, "sprites"
    LoadPic .GhoulPic, "ghoul2", 2, "sprites"
    LoadPic .GhoulPic, "ghoul3", 3, "sprites"
    LoadPic .GhoulPic, "ghoul4", 4, "sprites"
   
   LoadingForm.Info.Caption = "Loading...Food"
    LoadPic .Beer, "beer", 0, "food"
    LoadPic .Life, "1up", 0, "food"
    LoadPic .Cherry, "cherry", 0, "food"
    LoadPic .Berry, "berry", 0, "food"
    LoadPic .Protect, "protect", 0, "food"
    LoadPic .ShieldPic, "shield2", , "food"
    LoadPic .ShieldPicMsk, "shieldmsk2", , "food"
   
   LoadingForm.Info.Caption = "Loading...Title Screens"
    LoadPic .EndPicCon, "EndGameCon", , "titles"
    LoadPic .EndPicDie, "EndGameover", , "titles"
    LoadPic .ScoreImg, "score", , "titles"
    LoadPic .Title, "pacmanlogo", , "titles"
    LoadPic .MainPic, "mainpic", , "titles"
    LoadPic .Loading, "loadingscreen", , "titles"
  
  End With
 Unload LoadingForm 'loading complete
End Sub

⌨️ 快捷键说明

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