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
#2
No comments?
Reply
#3
Well this is a first, you all usually have something to say...
Reply
#4
Well, considering how long on average it takes anyone around here to reply to even the most ridiculous things. I figured an average of 3 hours between my posts was a bit over the norm.

Either way. I've been wanting to get some real feed back on this before I leave for a week tomorrow, so I know if I'm going to need to reprogram my map system or if this way should be efficient enough to work fine. I won't have internet where I'm going, I don't want to wait till I get back to start programming again, and I don't want to start programming the rest, only to get home and realize that what i have been doing was based off of something that wasn't worth pursuing.

So, does anybody have any intelligent (not insults or somethings else you all might think off Tongue) feedback on my system.
Reply
#5
Here's some feedback. Good work Smile
Reply
#6
Doh -_- Tongue

Thanks Smile
Reply
#7
The last 2 parameters are optional and you might get better FPS if you leave them out when you can. Light = -1 (which is .ARGB(255, 255, 255, 255) and Locked is false by default. So you don't need to use them.
Reply
#8
Also I have a question with As Point...

You make a new type, right?

Code:
Private Type Point
    X As Long
    Y As Long
End Type
Reply
#9
Isn't there POINT type in vb6 already?
Reply
#10
I don't think so.
Reply
#11
I just checked out, there is POINT type with X and Y variables
Reply
#12
My VB doesn't read Point. How to get it to work?
Reply
#13
Blodyavenger Wrote:I just checked out, there is POINT type with X and Y variables

What are you talking about? Points are UDTs.
Reply
#14
Alright Giaken, thanks, I'll check it out.

And at least my VB6 has POINTS already in. but if don't I suppose you could just make your own type, like Giaken posted. It'd be the same thing pretty much.
Reply
#15
That's weird...I can't find anything on a Point type.
Reply
#16
Maybe he didn't put "Option Explicit" in the very top of the module. If I don't do that and didn't define the variable I'm setting then I don't get any errors.
Reply
#17
You should always have "Option Explicit On". Look here for an explanation and why you should use it.
Reply
#18
Ok, just to satisfy you guys, I went and checked. And I have 'Option Explicit' at the top of all of my forms, modules, and classes.

So those of you who can't get it, 'tis fucked up Big Grin JK, just create a Type Point, with X as long and Y as long. And your good Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)