All you have to do is add this line to include any file you want:
doscript("aaa",{E=getfenv()})
And add this line at the very beginning of the included file (here, "aaa"):
setfenv(1,args.E)
And here you go, you don't even have to care about exporting stuff.
Now, about the game itself.
With this efficient way to write long programs, I have tried to create this space shooter, which uses a primitive game engine based on classes and bounding boxes. I may release this game engine later, when it's more reliable and easy to use. Right now, the game is in a very early version, there isn't really any HUD, there is only one short level with few enemies. As you can see, it currently runs at 7-10 fps, which isn't very fast, but heh, it's a calculator, not a Gameboy.
With this forum almost dead, I doubt many people will read this, but well, it's the only one ClassPad forum I know which isn't completely dead. Actually, I need some people who can try this game and give me some ideas for new enemies and gameplay concepts. And eventually some good coder who can look at the code and write some levels.
Get it here: http://kilburn.ftp.f...sPad/space3.mcs
It works only with CPLua 0.8 (you know that games don't run fast at all on CPLua 0.9). I added a fps control, so it should be playable on the emulator as well, though it may take some time to stabilize the framerate.
The main executable is Space\Space.
Commands are simple, use the directional pad to move, press "=" to fire the primary weapon, press "<-" to fire the secondary weapon, and press "0" to exit the level.
If you want to get rid of the FPS counter, comment the line "disp_fps=1" at the beginning of the main file. Same for "disp_mem" if you want to remove the memory counter.
Upgrades can be bought between levels with your score. The better score you get, the more upgrades you can buy. Generator upgrades make your energy charge faster, which is really useful especially if you have heavy weapons and shields that consume much energy.
Oh, also, I had to pack all this stuff quickly, so there may be pictures or other things missing, sorry for that. Just tell me and I'll fix it.
Now have fun, and thanks in advance for helping.