2d game map editor

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
foobar123

2d game map editor

Post by foobar123 »

I followed the 2d rendering tutorial, and did it in vb .net, but didnt like how it used a huge image, and thought it should use isometric tiling instead. I thought making a map format would be a good idea. Then I can create a 2d map editor, and just write the information. Here is the map format:

Code: Select all

'rect information | dest position | texture
0,0,342,224|50,50|media/stonepath.bmp
I wrote an easy sub routine to read the information.

Code: Select all

Public Class mapreader

    Public arpos(1) As String
    Public arcoords(3) As String
    Public Mystring(2) As String

    Public Sub readmap(ByVal path As String)

        Dim mapread As New StreamReader(path)

        Dim line As String

        'while not EOF
        While mapread.Peek <> -1

            'read each line into a string
            line = mapread.ReadLine()


            Mystring = Strings.Split(line, "|", -1) 'this would just be the string you get from your above code...


            arcoords = Strings.Split(Mystring(0), ",")


            arpos = Strings.Split(Mystring(1), ",")
        End While

    End Sub

End Class
and you can draw it by using the corresponding array values.

Code: Select all

 device.VideoDriver.Draw2DImage(images, New Position2D(read.arpos(0), read.arpos(0)), _
                    New Rect(read.arcoords(0), read.arcoords(1), read.arcoords(2), _
                    read.arcoords(3)), New Color(255, 255, 255, 255), True)
I am looking at developing a map editor for this....
Locked