own Commands in GLBasic?

Previous topic - Next topic

Leon

Hello,
is it possible to define own commands such as DRAW instead of DRAWSPRITE or LOAD instead of LOADSPRITE or something like that? I don't want to do such things with functions. Is it possible?
Thanks in advance

spacefractal

No, functions is the Way to do....
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Ian Price

As SF said functions are really the only easy way to do that eg.

Code (glbasic) Select

FUNCTION draw(x%,y%,image%)
DRAWSPRITE image,x,y
ENDFUNCTION


Do you not like the syntax, or are you used to something a bit different?
I came. I saw. I played.

Leon

Thanks for your answers. :)
Actually, I like the syntax but there is a program for the Nintendo 3DS called SmileBASIC that allows you to write games on the 3DS in basic. I wanted to write a simple wrapper so you could use the project made with SmileBASIC and export it to other platforms by using GLBasic.

erico


Leon

Thanks :)
Unfortunately, I don't know how to "create" own names for commands. I can't use functions for this because then it isn't a wrapper anymore since you can't use the commands used in SmileBASIC without adding "()" at the end of each command.

Ian Price

Actually, I had thought of doing exactly the same thing with regard to SmileBASIC, although I wanted to be able to write SmileBASIC programs on a pc, rather than the clunky touchscreen input method.

I recently bought a US 3DS purely to play Snapdots (a Guru Logic game that wasn't released in Europe) and other US only treats.

As a fan of the original 2DS only PetiteBASIC, I just had to buy the new version, which isn't available in Europe and don't know when it will be. So my US 3DS purchase worked out very well. The original PetiteBASIC had a VERY buggy pc interface that you could write code in that you could transfer to the DS.

There is a SmileBASIC competition going on right now (right through to January) - are you planning on entering?
I came. I saw. I played.

Leon

No, I'm not going to take part in it as I still have to wait till SmileBASIC's release in Europe :(
Are you going to enter?
I wanted to write the wrapper for Petit Computer and rewrite the wrapper as soon as SmileBASIC was released in Europe.
You wanted to do the same thing?  :D
Do you have an idea how to do this?

Ian Price

I have ideas, but not the time. I'd rather concentrate on making games though.

As for entering the comp, I'm not working on anything right now, but I have been giving it some serious thought.
I came. I saw. I played.

Leon

Could you tell me what your ideas to achieve a wrapper for it are? :)
Or are they extremely complex?

Ian Price

It wouldn't be a wrapper as such, more an IDE created with GLB. Not sure how feasible or even possible it would be, but needless to say it would be quicker to do it than explain it.
I came. I saw. I played.

erico

That is a nice plan Ian, so you would create an ide+parser to read text code from the smilebasic, and then compiling would translate that text to glbasic equivalent in functions? So it is more of a translator then a wrapper?

Ian Price

I came. I saw. I played.

Leon

Wow! Pretty good idea. :)
But that's really hard to achieve (at least for me  :( )

spacefractal

Was it not a glbasic compiler for smile basic? Not that other way?

That platform is interesting.

I'm would property do a wrapper compiling in blitz max to translate the syntax, which is great for this kind of uses, not glbasic it's self. This is to avoid folder clutter and etc, which can been annoying for tools.  I'm did that for small tools for Android and ios for automate icons and such ting.

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/