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: 197
Rated:


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:

SYSTEM GROUP
repetition(times)
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)

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

background(colorindex)
Clears the screen with colorindex. default background is black.

SPRITE GROUP

Creation and Destroying

sprite_create(id)
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.

sprite_destroy(id)
Destorys the sprite with the selected.

sprite_image(id,image)
Loads an image to the sprite with the id selected.

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

Handling

sprite_background(id)
Pastes the sprite to the background.

sprite_angle(id,angle)
Rotates the sprite by the angle selected.

sprite_quality(id,f)
Change the quality of resizing and rotating.
f=0 means simple.
f=1 means resampling.

sprite_hot(id,x,y)
Moves the hot spot to x,y.

sprite_width(id,width)
Changes the width of the sprite.

sprite_height(id,height)
Changes the height of the sprite.

sprite_x_pos(id,x)
Changes the sprite's X position.

sprite_y_pos(id,y)
Changes the sprite's Y position.

sprite_get_x_pos(id)
Returns the sprite's X position.

sprite_get_y_pos(id)
Returns the sprite's Y position.

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

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

MOUSE GROUP

mouse_x()
Reutrns the X position of the mouse relative the the window.

mouse_y()
Reutrns the Y position of the mouse relative the the window.

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

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

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

KEYBOARD

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

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

keyboard_get_key_id(keystring)
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



   


http://clickteam.info/neatwares/downloads/GBasic.zip (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

Ok
Those will be added in the next Engine Beta.
@Davince:
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:
var=2;
varb="5";
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!
 

 



Author

Favourite



Advertisement

Worth A Click