Hello. Can some one help, please?
I've searched the forums, searched the web and searched Sloan's book; but I still can't find an effective example of how BlitzMax handles types as opposed to Blitz3D. I'm okay with defining them, but accessing them through a loop has me stumped. I know B3D used a kind of FOR F=EACH TYPE sort of thing!
Would some one be so kind as to write a short bit of code that defines a type with a couple of fields, and then goes through them using a loop, please?
Eg.
TYPE BULLET
FIELD x,y
END TYPE
FOR F=0 TO 10
Local b:bullet
b=New bullet
b.x=RAND(1,200)
b.y=RAND(1,200)
NEXT
.........what next, how do I loop through them?
Many thanks in advance - please keep it simple.
Tobo.
I've searched the forums, searched the web and searched Sloan's book; but I still can't find an effective example of how BlitzMax handles types as opposed to Blitz3D. I'm okay with defining them, but accessing them through a loop has me stumped. I know B3D used a kind of FOR F=EACH TYPE sort of thing!
Would some one be so kind as to write a short bit of code that defines a type with a couple of fields, and then goes through them using a loop, please?
Eg.
TYPE BULLET
FIELD x,y
END TYPE
FOR F=0 TO 10
Local b:bullet
b=New bullet
b.x=RAND(1,200)
b.y=RAND(1,200)
NEXT
.........what next, how do I loop through them?
Many thanks in advance - please keep it simple.
Tobo.