The Daily Click ::. Downloads ::. Miscellaneous ::. GBasic Engine Public Beta 2

GBasic Engine Public Beta 2
Author: LIJI Submitted: 18th January, 2007 Favourites:0
Genre: Miscellaneous Downloads: 109

Edited By LIJI on 1/19/2007

GBasic is a programming language made with MMF2, based on the powerful LUA extension, and used mainly for making games.
GBasic full will include a full code editor and a compiler to make exes.
ATM, this beta of the engine will ask you to choose a .GBS file (GBasic source) to run. Note that files used by the source code are relative to the GBasic engine exe file and NOT the source (this won't cause problems after the compiler is done and it can make EXEs).

GBasic functions that can be used in your game:

How many times should the GBasic engine run the main() function. should be used outside of any function for the first time. Can be called for more than 1 time. Enter -1 for endless loop. You can do repetition(0) at any time to stop the game. (Yet it will not close)

Change the FPS (frames per seconds) of the game, defualt 100.

Clears the screen with colorindex. default background is black.


Creation and Destroying

Creates a sprite with the id selected.
Note: You should never have 2 or more sprites with the same id.
The GBasic engine does allow it and won't stop the application, will not handle it currectly.

Destorys the sprite with the selected.

Loads an image to the sprite with the id selected.

Return 1 if the sprite with the id selected exist, 0 if not.


Pastes the sprite to the background.

Rotates the sprite by the angle selected.

Change the quality of resizing and rotating.
f=0 means simple.
f=1 means resampling.

Moves the hot spot to x,y.

Changes the width of the sprite.

Changes the height of the sprite.

Changes the sprite's X position.

Changes the sprite's Y position.

Returns the sprite's X position.

Returns the sprite's Y position.

Sets value "key" (int) of the sprite "id" to "value".

Returns value "key" (int) of the sprite "id".


Reutrns the X position of the mouse relative the the window.

Reutrns the Y position of the mouse relative the the window.

Returns 1 if the left button is clicked (Clicked, NOT down), 0 if not.

Returns 1 if the right button is clicked (Clicked, NOT down), 0 if not.

Returns 1 if the right button is clicked (Clicked, NOT down), 0 if not.


Returns 1 if the key with the key id `key` if it's pressed, 0 if not.

Returns 1 if the key with the key id `key` if it's down, 0 if not.

Returns the key id of keystring.
For example:
keyboard_get_key_id( "space" ) will return 32.

The download includes full commented example games of a breakout game and a card matching game. Have fun testing!

If you have any idea of more groups (Example: Sound) or more functions (Example mouse_left_button_down()), don't be shy and post it.

Review This Download (869 kkb )

Posted by DaVince 18th January, 2007

Looking nice. About the language, I don't like how you type your functions though, I'm used to stuff like IsKeyPressed(), not keyboard_key_pressed(). But very nice effort.
Posted by Michael P 18th January, 2007

Nice! Few suggestions. Make an IDE to write the code in etc. And add a function, such as window_title([title as string]) to change the title of the window (if possible in MMF2 via events and stuff, i dont remember now...) Ability to change window size would be nice too
Posted by LIJI 19th January, 2007

Those will be added in the next Engine Beta.
I'll include an optional header in the compiler that will allow both functions if included.
Posted by axel 19th January, 2007

Ooh, you showed me an early beta of this on MSN, some months ago. Downloading...
Posted by Michael P 19th January, 2007

OH! Also, need some sound stuff! And are variables possible (my_variable$="woohoo") etc.
Posted by vortex2 19th January, 2007

Nice .
Posted by LIJI 20th January, 2007

@Michael P:
Sounds group will be added obviously in next betas
GBasic can use LUA's varibles in this syntax:
varc=var+varb; --varc=7
vard=varc..varb; --vard="75"
var="mystring"; --The value which was number type became string

Check the card game example for a good use of varibles.
Posted by LIJI 27th January, 2007

Any more suggestions? bugs?
Posted by Wicked Studios 10th February, 2007

umm... why would you use a simpler coding process to create a more complicated one.... just seems kinda pointless to me
Posted by ben mercer 21st February, 2007

Exactly my opinion. Why would people write games in this when they can just write them in MMF? What was wrong with just using LUA on it's own?

The place that something like this could come in useful is if you had written a game engine and then you could use scripting to control triggered events etc. without hard coding them.
Posted by Melli Georgiou 6th April, 2009
Rated :

Just thought I'd leave a quick message and say I think this has loads of potential! Well done LIJI for thinking out of the box! I salute you!





Worth A Click