Mirage Source
http://miragesource.net/forums/

My Map Type...
http://miragesource.net/forums/viewtopic.php?f=143&t=5772
Page 1 of 1

Author:  Pbcrazy [ Sat Jun 06, 2009 7:38 pm ]
Post subject:  My Map Type...

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?

Author:  Pbcrazy [ Sat Jun 06, 2009 9:26 pm ]
Post subject:  Re: My Map Type...

No comments?

Author:  Pbcrazy [ Sun Jun 07, 2009 1:55 am ]
Post subject:  Re: My Map Type...

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

Author:  James [ Sun Jun 07, 2009 1:57 am ]
Post subject:  Re: My Map Type...

Spam to get comments usually doesn't make people want to talk about what you actually say.

Author:  Pbcrazy [ Sun Jun 07, 2009 2:08 am ]
Post subject:  Re: My Map Type...

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 :P) feedback on my system.

Author:  Beres [ Sun Jun 07, 2009 6:44 am ]
Post subject:  Re: My Map Type...

Here's some feedback. Good work :)

Author:  Pbcrazy [ Sun Jun 07, 2009 12:52 pm ]
Post subject:  Re: My Map Type...

Doh -_- :P

Thanks :)

Author:  GIAKEN [ Sun Jun 07, 2009 9:18 pm ]
Post subject:  Re: My Map Type...

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.

Author:  GIAKEN [ Mon Jun 08, 2009 2:04 am ]
Post subject:  Re: My Map Type...

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

Author:  Blodyavenger [ Thu Jun 11, 2009 11:33 pm ]
Post subject:  Re: My Map Type...

Isn't there POINT type in vb6 already?

Author:  GIAKEN [ Fri Jun 12, 2009 12:05 am ]
Post subject:  Re: My Map Type...

I don't think so.

Author:  Blodyavenger [ Fri Jun 12, 2009 12:46 am ]
Post subject:  Re: My Map Type...

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

Author:  Beres [ Fri Jun 12, 2009 2:11 am ]
Post subject:  Re: My Map Type...

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

Author:  Tony [ Fri Jun 12, 2009 4:04 am ]
Post subject:  Re: My Map Type...

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


What are you talking about? Points are UDTs.

Author:  Pbcrazy [ Sun Jun 14, 2009 6:45 pm ]
Post subject:  Re: My Map Type...

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.

Author:  GIAKEN [ Sun Jun 14, 2009 10:14 pm ]
Post subject:  Re: My Map Type...

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

Author:  Tony [ Mon Jun 15, 2009 8:29 am ]
Post subject:  Re: My Map Type...

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.

Author:  Toast [ Tue Jun 16, 2009 3:07 pm ]
Post subject:  Re: My Map Type...

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

Author:  Pbcrazy [ Tue Jun 16, 2009 3:13 pm ]
Post subject:  Re: My Map Type...

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 :D JK, just create a Type Point, with X as long and Y as long. And your good :D

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/