Skip to content
/ GMLux Public

A GML to GML transpiler that adds support for lightweight objects in the form of arrays

License

Notifications You must be signed in to change notification settings

nommiin/GMLux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GMLux

A GMLux to GML transpiler that adds support for lightweight objects in the form of arrays

GMLux Language

GMLux stands for GameMaker L(anguage)uxury, where the luxury is the ability to use lightweight objects in GM!

Example:

#define main
object oPlayer = {
    x: 32,
    y: 32,
    speed: 8
};

#define step
if (keyboard_check(vk_left) == true) {
    oPlayer.x -= oPlayer.speed;
} else if (keyboard_check(vk_right) == true) {
    oPlayer.x += oPlayer.speed;
}

if (keyboard_check(vk_up) == true) {
    oPlayer.y -= oPlayer.speed;
} else if (keyboard_check(vk_down) == true) {
    oPlayer.y += oPlayer.speed;
}

#define draw
draw_rectangle(oPlayer.x - 8, oPlayer.y - 8, oPlayer.x + 8, oPlayer.y + 8, false);

transpiles into:

#define main
/*GMLuxCreate*/ oPlayer = [/*x*/32, /*y*/32, /*speed*/8];

#define step
if (keyboard_check(vk_left) == true) {
    oPlayer[/*x*/0] -= oPlayer[/*speed*/2];
} else if (keyboard_check(vk_right) == true) {
    oPlayer[/*x*/0] += oPlayer[/*speed*/2];
}

if (keyboard_check(vk_up) == true) {
    oPlayer[/*y*/1] -= oPlayer[/*speed*/2];
} else if (keyboard_check(vk_down) == true) {
    oPlayer[/*y*/1] += oPlayer[/*speed*/2];
}

#define draw
draw_rectangle(oPlayer[/*x*/0] - 8, oPlayer[/*y*/1] - 8, oPlayer[/*x*/0] + 8, oPlayer[/*y*/1] + 8, false);

About

A GML to GML transpiler that adds support for lightweight objects in the form of arrays

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published