Mappy with Blitz Max

BlitzMax Forums/BlitzMax Beginners Area/Mappy with Blitz Max

Olla(Posted 2006) [#1]
I'm using Mappy and everything is fine, expect from I don't kn ow how to look at the block properties (user data)? In Blitz Basic I did it like this example:

b.BLKSTR = MapGetBlock (xpos,ypos)
If (b\user1 = z) Then something

But for whatever reason it doesn't work under Max, does anybody know how to do it?

Thanks in advance...


JazzieB(Posted 2006) [#2]
The syntax for Types in BlitzMax is different than that of Blitz Basic or B3D. An object type is defined with ':' and the fields are accessed with '.', so the above code would translate as...

b:BLKSTR = MapGetBlock(xpos,ypos)
If (b.user1 = z) Then ' something!

MapGetBlock would have to return a BLKSTR type.

I've not used Mappy myself, so can't help you any more than that. You may need to provide more information before someone who has can help you out, as you've been a little on the vague side about the problem you get. Does Mappy come with BiitzMax source or are you trying to convert Blitz Basic code?