PDA

Click to See Complete Forum and Search --> : my website


drewski
Mar 7th, 2001, 12:22 AM
hey people i've upadated my website and now its a whole ne design. go check it out and let me know what you think. also take a look at my map editor and let me know what you think. its not complete yet buts its got all of the basics for now.

by the way. how come on the editor when i hold the mouse down and drag it only draw one square instead of a whole line of them. i think i know how to make it work but if anyone has any suggestions i'm completely open to them.

thanks one and all,
Drewski

pranavdesai
Mar 7th, 2001, 12:03 PM
that's good work friend

drewski
Mar 7th, 2001, 03:01 PM
my map type is *.map
if you look in the code under loadmapfromfile or something like that you should be able to find it.

thanks for the feed back guys

Drewski

drewski
Mar 7th, 2001, 04:16 PM
if you guys want the code posted i can do that just you'll have to wait till i get home. but if you already have it just look around for it in the source. by the way, sorry if the code isnt that pretty and i'm not much on commenting my code. hopefully you can piece it out ;)

drewski
Mar 7th, 2001, 11:14 PM
heres the map format chris:


Public Type TileArray
SrcX As Long
SrcY As Long
DestX As Long
DestY As Long
Walkable As Byte
TileSet As Byte
End Type

Public Type LayerArray
Tile() As TileArray
End Type

Public Type Map
StartX As Byte
StartY As Byte
BGround As LayerArray
'FGround As LayerArray
'Triggers As LayerArray
'Items As LayerArray
End Type


Public Sub LoadMapFromFile()
Dim Level As Map 'dim a variable that will be used to determine the length of a record in the file
Dim Number As Integer
Dim FileName As String 'dim a variable to hold the name of the map
Dim intFileFree As Integer 'dim a variable to hold a handle to the next available free file
Dim RecordNumber As Long 'dim a variable to track what record we are on
Dim RecordLength As Long 'dim a variable to hold the length of a record

On Error GoTo ErrorHandler


Form1.CmnDialog.Filter = "Map files (*.map)|*.map"
Form1.CmnDialog.flags = cdlOFNFileMustExist
Form1.CmnDialog.flags = cdlOFNHideReadOnly
Form1.CmnDialog.DialogTitle = "Load Map"
Form1.CmnDialog.ShowOpen

strMapName = Form1.CmnDialog.FileName
If strMapName = "" Then Exit Sub

intFileFree = FreeFile


Open strMapName For Binary As #intFileFree

RecordNumber = 1
RecordLength = CLng(Len(Number))

Get #intFileFree, RecordNumber, MapWidth
RecordNumber = RecordNumber + RecordLength
Get #intFileFree, RecordNumber, MapHeight

ReDimArrays

RecordNumber = RecordNumber + RecordLength
Get #intFileFree, RecordNumber, Level1

Level1.BGround.Tile(1, 1).DestX = Level1.BGround.Tile(1, 1).DestX

Close #intFileFree


Exit Sub

ErrorHandler:
If Err.Number = cdlCancel Then
Exit Sub
End If
End Sub


i got this code from the game examples off of oneringsoftware.com. thats the place where i first started vbgp. ah the memories ;)

Chris
Mar 7th, 2001, 11:48 PM
thanks drewski, I'll take a look on it.

drewski
Mar 13th, 2001, 12:19 AM
hey people check it out! the website is updated. check it out and give me some input here. by the way pranavdesai i would like a little more than just "good work friend" i thank you graciously for the compliment but i need a little more input.

thanks y'all