📄 scheme.bas
字号:
Attribute VB_Name = "Scheme"
Public Enum SchemeType 'set the scheme type
SchStandard = 0
SchChocolate = 1
SchSpace = 2
SchSky = 3
SchChristmas = 4
SchMetal = 5
End Enum
'This Will Load the Scheme
Global Scheme As SchemeType 'the current scheme
Global LevScheme As String 'the scheme when it is taken from the level (as a string)
Global WallTypeNum As Integer 'the type of wall that is used
'this will scort which subs are called when loading a scheme
Public Function Load_Scheme(WScheme As SchemeType)
Scheme = WScheme 'set the global scheme to the scheme given
MainFrm.Score.ForeColor = vbBlack 'set the score to black(if the background is black this will be changed)
'select the correct scheme and call the sub that loads it.
Select Case Scheme
Case Is = 0
LoadStdScheme
Case Is = 1
LoadChocolateScheme
Case Is = 2
LoadSpaceScheme
Case Is = 3
LoadSkyScheme
Case Is = 4
LoadChristmasScheme
Case Is = 5
LoadMetalScheme
End Select
End Function
Public Sub SetSchWall() 'changes the normal walls to the set wall scheme
With MainFrm
On Error Resume Next 'errors only happen if the wall(array) doesn't exsist
For I = 0 To .Wall.UBound 'go through each wall array
Select Case Scheme 'select the scheme
Case Is = 0 'set the wall to the set schemes wall
.Wall(I).Picture = .StdWall(WallTypeNum).Picture
Case Is = 1 'set the wall to the set schemes wall
.Wall(I).Picture = .ChocolateWall(WallTypeNum).Picture
Case Is = 2 'set the wall to the set schemes wall
.Wall(I).Picture = .SpaceWall(WallTypeNum).Picture
Case Is = 3 'set the wall to the set schemes wall
.Wall(I).Picture = .SkyWall(WallTypeNum).Picture
Case Is = 4 'set the wall to the set schemes wall
.Wall(I).Picture = .ChristmasWall(WallTypeNum).Picture
Case Is = 5 'set the wall to the set schemes wall
.Wall(I).Picture = .MetalWall(WallTypeNum).Picture
End Select
Next
End With
End Sub
'the next subs all have the same set-out, which is as follows
Private Sub LoadChocolateScheme()
With MainFrm 'refer to objects on the MainFrm
.Area.Picture = .ChocolateBack.Picture 'set the background
.Wall(0).Picture = .ChocolateWall(0).Picture 'set the wall picture
.InfoPane.Picture = .Area.Picture ' set the info-picturebox to the schemes background
.Food(0).Picture = .ChocolateFood.Picture 'set the food to the schemes food
End With 'stop refering to the the mainfrms objects.
End Sub
Private Sub LoadChristmasScheme()
With MainFrm
.Area.Picture = .ChristmasBack.Picture
.Wall(0).Picture = .ChristmasWall(Int(Rnd * 2)).Picture
.InfoPane.Picture = .Area.Picture
.Food(0).Picture = .ChristmasFood.Picture
End With
End Sub
Private Sub LoadSpaceScheme()
With MainFrm
.Area.Picture = .SpaceBack.Picture
.Wall(0).Picture = .SpaceWall(0).Picture
.InfoPane.Picture = .Area.Picture
.Food(0).Picture = .SpaceFood.Picture
.Score.ForeColor = vbWhite 'as the background is black, set the score text to white
End With
End Sub
Private Sub LoadMetalScheme()
With MainFrm
.Area.Picture = .MetalBack.Picture
.Wall(0).Picture = .MetalWall(0).Picture
.InfoPane.Picture = .Area.Picture
.Food(0).Picture = .MetalFood.Picture
End With
End Sub
Private Sub LoadSkyScheme()
With MainFrm
.Area.Picture = .SkyBack.Picture
.Wall(0).Picture = .SkyWall(0).Picture
.InfoPane.Picture = .Area.Picture
.Food(0).Picture = .SkyFood.Picture
End With
End Sub
Private Sub LoadStdScheme()
With MainFrm
.Area.Picture = .StdBack.Picture
.Wall(0).Picture = .StdWall(0).Picture
.InfoPane.Picture = .Area.Picture
.Food(0).Picture = .StdFood.Picture
End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -