Mirage Source
My Map Type... - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Programming (https://mirage-engine.uk/forums/forumdisplay.php?fid=24)
+----- Forum: Visual Basic 6 (https://mirage-engine.uk/forums/forumdisplay.php?fid=32)
+----- Thread: My Map Type... (/showthread.php?tid=2843)



My Map Type... - Pbcrazy - 06-06-2009

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?


Re: My Map Type... - Pbcrazy - 06-06-2009

No comments?


Re: My Map Type... - Pbcrazy - 07-06-2009

Well this is a first, you all usually have something to say...


Re: My Map Type... - Pbcrazy - 07-06-2009

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.


Re: My Map Type... - Beres - 07-06-2009

Here's some feedback. Good work Smile


Re: My Map Type... - Pbcrazy - 07-06-2009

Doh -_- Tongue

Thanks Smile


Re: My Map Type... - GIAKEN - 07-06-2009

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.


Re: My Map Type... - GIAKEN - 08-06-2009

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



Re: My Map Type... - Blodyavenger - 11-06-2009

Isn't there POINT type in vb6 already?


Re: My Map Type... - GIAKEN - 12-06-2009

I don't think so.


Re: My Map Type... - Blodyavenger - 12-06-2009

I just checked out, there is POINT type with X and Y variables


Re: My Map Type... - Beres - 12-06-2009

My VB doesn't read Point. How to get it to work?


Re: My Map Type... - Tony - 12-06-2009

Blodyavenger Wrote:I just checked out, there is POINT type with X and Y variables

What are you talking about? Points are UDTs.


Re: My Map Type... - Pbcrazy - 14-06-2009

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.


Re: My Map Type... - GIAKEN - 14-06-2009

That's weird...I can't find anything on a Point type.


Re: My Map Type... - Tony - 15-06-2009

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.


Re: My Map Type... - Toast - 16-06-2009

You should always have "Option Explicit On". Look here for an explanation and why you should use it.


Re: My Map Type... - Pbcrazy - 16-06-2009

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