ZDCode II: The language that compiles to compatible DECORATE!
Posted: Sat Oct 20, 2018 12:45 am
ZDCode II: The language that compiles to compatible DECORATE!
ZDCode is a compiled language that will be converted into DECORATE. It is compatible with most versions of DECORATE, depending on however you use it (but won't use DECORATE anonymous functions).
Either way, it's a powerful language, where you can use if and while statements, X-blocks (which repeat a statement or block thereof N times), and you can fold multiple actions into a single frame. You can also call functions, so you don't need to worry about where you called it, what jumps to do; keeping track of those annoying things sucks, doesn't it?
Alright, enough nonsense! Take this example:
As you can see, throwing it into ZDCode will output a bunch of obnoxious and barely indented DECORATE, but hey, it works perfectly! You're not meant to touch the output, after all!
You can get the latest compiler binaries over at GitHub.
ZDCode is a compiled language that will be converted into DECORATE. It is compatible with most versions of DECORATE, depending on however you use it (but won't use DECORATE anonymous functions).
Either way, it's a powerful language, where you can use if and while statements, X-blocks (which repeat a statement or block thereof N times), and you can fold multiple actions into a single frame. You can also call functions, so you don't need to worry about where you called it, what jumps to do; keeping track of those annoying things sucks, doesn't it?
Alright, enough nonsense! Take this example:
Code: Select all
class RunZombie inherits ZombieMan replaces ZombieMan #2055
{
set Gravity to 0.4; // high up...
set Speed to 0;
is NOBLOCKMONST;
set Speed to 0;
label See
{
POSS AB 5 A_Recoil(-0.7);
TNT1 A 0 A_Chase;
POSS A 0 A_FaceTarget();
POSS AB 4 A_Recoil(-0.7);
TNT1 A 0 A_Chase;
POSS A 0 A_FaceTarget();
POSS ABCD 3 A_Recoil(-0.7);
TNT1 A 0 A_Chase;
POSS A 0 A_FaceTarget();
goto RunLoop;
};
function Jump
{
while ( z == floorz )
{
POSS A 5 [Bright];
POSS A 11 ThrustThingZ(0, 30, 0, 1);
};
POSS AB 2 A_Chase;
};
label RunLoop
{
x3
{
POSS ABCD 2 A_Recoil(-0.7);
TNT1 A 0 A_Chase;
POSS A 0 A_FaceTarget();
};
if ( health > 5 )
call Jump;
loop;
};
}
You can get the latest compiler binaries over at GitHub.