Skip to content
/ gamecake Public

GameCake is a cross platform build of Lua(JIT) with embedded libraries.

License

Notifications You must be signed in to change notification settings

xriss/gamecake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeFresh : Codefresh build status

Autogenerated code documentation can be found at https://xriss.github.io/gamecake/ so go there if that is what you are interested in, the rest of this readme concerns the process of building gamecake from source.

If you want to build then you should clone and then run the git-pull script to make sure everything is up to date.

git clone https://github.com/xriss/gamecake.git
cd gamecake
./git-pull

It is best to always use this script to git pull the latest everything so that git is less likely to get its knickers in a twist.

./git-pull

Releases are compiled inside the vbox_* directories (linux32/linux64/raspi/emscipten/windows) which contain vagrant or qemu boxes setup to build the code in a controlled environment via a ./make script. The latest code built this way can be found in the exe branch and a zip of them all can be downloaded from https://github.com/xriss/gamecake/archive/exe.zip

For a linuxy build, the big required build/lib dependencies are luajit and SDL2. You have two choices either install via a package manager, the following script should do that along with making sure you have a basic build environment setup. If it does not work or you do not trust it then read it and install the bits it asks for yourself.

./install-build-dependencies

Some of the dependencies can be built and installed from source which the following script will try to do. This is normally run inside a virtual machine so might actually work.

build/install

Then you may use these scripts to make and install.

./make
sudo ./install

For some more options when building (eg use clang) see the output of

./make --help

EG I have successfully built an exe under WSL in Windows 10 using the following to install tools/libs and then build using mingw.

build/install --mingw
build/make --gcc=mingw

Alternatively any vbox_* directory can build a specific executable. For instance vbox_64 can be used to build a 64bit executable inside an ubuntu vagrant box. See readme files inside these directories for more information.

Once built the engine lives in one single fat binary that includes many lua libraries. For convenience gamecake is a command line compatible replacement for lua. The only diference is we have C libraries and Lua libraries from this repository embedded and ready to be required by your lua code.

We are also setup to auto build snaps via https://snapcraft.io/gamecake the following should get you a snap install of gamecake.

SnapCraft : gamecake

sudo snap install gamecake
sudo snap connect gamecake:joystick :joystick
sudo snap connect gamecake:alsa :alsa

Gamecake is now slowly becoming fully available as a luarock, all our custom libraries can be installed at once with.

sudo luarocks install gamecake

This is still under development but is already the replacement for the older webserver pagecake builds. I now use a generic openresty combined with a luarocks gamecake install.

This is a bit of a hassle to setup, as all server things are, but basically it means install openresty and then do something like https://openresty.org/en/using-luarocks.html to install luarocks that openresty can see and then use that luarocks to install gamecake which will get us all the gamecake libs inside an nginx lua environment.

Finally some things you can try once you have a working gamecake executable installed.

# run swanky edit our internal text editor and IDE
gamecake -lcmd -- swed

# run a fun64 demo ( https://github.com/xriss/fun64/tree/master/fun )
gamecake -lfun -- lua/fun/helloworld
gamecake -lfun -- lua/fun/raymarch
gamecake -lfun -- lua/fun/palette
gamecake -lfun -- lua/fun/invaders
gamecake -lfun -- lua/fun/platform
gamecake -lfun -- lua/fun/overstep