Attribute VB_Name = "modMapSuelta"
Option Explicit



Type TPantalla
    Ancho As Single
    Alto As Single
    IconoAnchoX As Single
    IconoAltoY As Single
    NumPanCol As Integer
    NumPanRen As Integer
End Type

Type TPicsGame
    rutaDir As String
    ArrPics() As String
    NumPics As String
End Type


Type TVariasEscenas
    ArrTipoEscenasTdo() As String
    NumArrTipoEscenasTdo As Integer
    objPantalla As TPantalla
    objPics As TPicsGame
End Type


Type TPosicionRC
    c As Integer
    r As Integer
End Type


Public mObjEscenasVarias As TVariasEscenas

Public Sub IniciarPantalla(picMain As PictureBox)
    '640/20=32
    '480/15=32
    mObjEscenasVarias.objPantalla.Ancho = 640
    mObjEscenasVarias.objPantalla.Alto = 480
    mObjEscenasVarias.objPantalla.NumPanCol = 20
    mObjEscenasVarias.objPantalla.NumPanRen = 15
    mObjEscenasVarias.objPantalla.IconoAltoY = 32
    mObjEscenasVarias.objPantalla.IconoAnchoX = 32
    
    picMain.ScaleMode = vbPixels
    picMain.Width = mObjEscenasVarias.objPantalla.Ancho
    picMain.Height = mObjEscenasVarias.objPantalla.Alto
    
    Call HacerCuadriculado(picMain)
End Sub


Public Sub HacerCuadriculado(pPicGame As PictureBox)
    Dim i As Long
    Dim j As Long
    Dim pasox As Long
    Dim pasoy As Long
    Dim tamx As Long
    Dim tamy As Long

    pPicGame.ScaleMode = vbPixels

    tamx = pPicGame.ScaleWidth
    tamy = pPicGame.ScaleHeight

    pasox = tamx / mObjEscenasVarias.objPantalla.NumPanCol
    pasoy = tamy / mObjEscenasVarias.objPantalla.NumPanRen

    'linea horizontal
    For i = 0 To tamx Step pasox
        pPicGame.Line (i, 0)-(i, tamy), vbBlue
    Next i

    'linea vertical
    For j = 0 To tamy Step pasoy
        pPicGame.Line (0, j)-(tamx, j)
    Next j



End Sub



Public Sub IniciarGameChRunVert()
Dim ren As Integer
Dim col As Integer
    mObjMapa.NumRenMapa = mObjEscenasVarias.objPantalla.NumPanRen
    mObjMapa.NumColMapa = mObjEscenasVarias.objPantalla.NumPanCol
    
    ren = mObjMapa.NumRenMapa
    col = mObjMapa.NumColMapa

    ReDim MGameChRun.ArrRenColLineaBi(ren, col)

End Sub


