The Magic Tower of Saving the White Lady~My first small game source code made by VB6+DX8~10 map editor-cartoon drawing

The complete project of
"Magic Tower Saves the White Lady" download link: "Magic Tower Saves the White Lady" map editor-background drawing: the background drawn by this subroutine is static. If you draw a dynamic one, please refer to the dynamic background Draw in the complete project. program:

Sub 背景Draw()
   
    Dim j As Integer
    
    Dim k As Integer
   Dim m() As String
   
   Dim n As Integer
   
'绘制作战区域
   
    图片X坐标 = 0
    图片Y坐标 = 0
    
    For k = 0 To 12
    If k > 12 Then Exit For
    m = Split(地图数据(k), ",")

For n = 0 To 12
图片编号(n) = Val(m(n))

'写文件LOG ("k=" & k & "图片编号:" & 图片编号(n))
Next n

   For j = 0 To 12

'If j > 12 Then Exit For
If 图片编号(j) < 80 Then
       With 储存基本的物体图形数组(图片编号(j))
            .Cell = 1
            .DrawGraph 图片X坐标 + j * 32, 图片Y坐标
        End With
        End If
        
   If 图片编号(j) > 79 Then
   
       With 储存基本的物体图形数组(80)
            .Cell = 图片编号(j) - 79
            .DrawGraph 图片X坐标 + j * 32, 图片Y坐标
        End With
        End If
        
'Debug.Print "当前K=" & k & "当前J=" & j & "当前图片编号:" & 图片编号(j) & "图片X坐标:" & 图片X坐标 + j * 32 & "图片Y坐标:" & 图片Y坐标
    
' 写文件LOG ("当前K=" & k & "当前J=" & j & "当前图片编号:" & 图片编号(j) & "图片X坐标:" & 图片X坐标 + j * 32 & "图片Y坐标:" & 图片Y坐标)
    
    
    Next j

   图片Y坐标 = 图片Y坐标 + 32
   
  '
    
   Next k
  Erase m()
 Erase 图片编号()
End Sub

The function of this code is to read the relative cartoon picture according to the map data and draw it to the relative coordinate.

Guess you like

Origin blog.csdn.net/gosub60/article/details/112849118