Is BlitzPlus code runnable in BlitzMax?

BlitzMax Forums/BlitzMax Beginners Area/Is BlitzPlus code runnable in BlitzMax?

Ben M(Posted 2013) [#1]
I've had BlitzPlus for years now, but would like to be able to run games on multiple platforms (Max/Linux).

How much tweaking is involved to get a BlitzPlus game running in BlitzMax? If any.


Ben M(Posted 2013) [#2]
The Orientation Guide has all this information.

I read "orientation" as "screen orientation", not as in my orientation to BlitzMax :)

I have been developing on mobile for a couple years.... can you tell?


Midimaster(Posted 2013) [#3]
there are a dozend of commands, where the syntax is different. as...
[bbcode]Text 10,10,"Hallo"

DrawText "Hallo", 10,10[/bbcode]
but you could "cast" them:
[bbcode]Function Text (X%, Y%, T$)
DrawText T$,X,Y
End Function
[/bbcode]
... or replace them.



There are some syntex differences in Types:

[bbcode]T.Enemy = New Enemy
T\X=10

T:Enemy=New Enemy
T.X=10[/bbcode]



BMax forces you to use a lot of special types,where B+ uses always INTEGER handles:

[bbcode]File%=OpenFile("....

File:TStream=Openfile("....[/bbcode]
but if you first do not set the BMax directive SUPERSTRICT, your Bmax will not be too strict to you in such things.



But the logic of the Code and of the GUI is quit the same. So I would say, that o code of 100 lines can be converted in half an hour and 2000 lines in a day.

Last edited 2013


Mahan(Posted 2013) [#4]

but if you first do not set the BMax directive SUPERSTRICT, your Bmax will not be too strict to you in such things.


I would highly recommend SuperStrict for new BlitzMax users.

The typed handles (or references) are a very valuable evolution over B+. You will get compiler error messages if you try to use the wrong type in the wrong place in your code. It will actually tell you what type it expected and what it got. This is a huge advantage over B+ imho and can potentially save lots of "hair tear" when projects get big.

DrawImage <wrong type>, x, y

Will give you something like "Got TStream. Expected TImage."


Midimaster(Posted 2013) [#5]
if you have a valid running B+ code and try to convert him to BMax it could be very helpful not to set SUPERSTRICT. In a first step you can convert all deep problems. And in a second step you can switch on SUPERSTRICT to optimize the code to BMax.

I agree: SUPERSTRICT is highly recommended, when starting a new (virgin) BMax project.


Brucey(Posted 2013) [#6]
But the logic ... of the GUI is quit[e] the same

Is it? That would explain a lot :-(

Better to stay the same than to improve the design. Ho hum.


xlsior(Posted 2013) [#7]
In the BlitzMax IDE, there is an 'import BB project' which will translate the 'easy' substitutions for you.

It's not perfect, but may help with simple projects.
for more complex projects, it's often easier to rewrite it from scratch than try to get the old code to work.