Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My Map Type...
#1
Alright, so I'm trying to get proper maps implimented into my... demo i guess. It's not a game yet.

And i've been trying to do it on my own, without looking at other source.

Here is what i have come up with

Code:
Type Tile
    Ground As Point
    Mask As Point
    Fringe As Point
End Type

Type Map
    MapName As String
    Tile(1 To MAX_MAP_X, 1 To MAX_MAP_Y) As Tile
End Type

Public Map(1 To 5) As Map

I made each layer a point, so you can also have the tile x and y offset for the tilesheet

Example

Map(MapNum).Tile(x, y).Ground.X would be the ground tile at spot X by Y on the map, and .X is the X offset for the Tilesheet

hmm. perhaps my entire rendering sub may be necessary, since im not good at explaining.

Code:
Public Sub DrawMap()
Dim x As Long
Dim y As Long

With CDX8
.SetTexture TextureID.Tiles

For x = 0 To MAX_MAP_X - 1
    For y = 0 To MAX_MAP_Y - 1
        
        .TextureControl (x * 32) + 8, (y * 32) + 8, 32, 32, Map(1).Tile(x + 1, y + 1).Ground.x * 32, Map(1).Tile(x + 1, y + 1).Ground.y * 32, .ARGB(255, 255, 255, 255), False
        .Draw
        
    Next y
Next x
End With
End Sub

Albiet, this only renders the ground layer right now.

Note:
Code:
.TextureControl StartX, StartY, Width, Height, Xoffset, Yoffset, .ARGB, Locked?

What do you guys think? Really crappy? or not so bad?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)