https://github.com/megagrump/yuema
raylib + LuaJIT + Yuescript
https://github.com/megagrump/yuema
game-development lua luajit raylib yuescript
Last synced: about 1 year ago
JSON representation
raylib + LuaJIT + Yuescript
- Host: GitHub
- URL: https://github.com/megagrump/yuema
- Owner: megagrump
- License: mit
- Created: 2022-02-05T17:57:38.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-01T11:40:05.000Z (over 4 years ago)
- Last Synced: 2025-04-12T02:11:45.077Z (about 1 year ago)
- Topics: game-development, lua, luajit, raylib, yuescript
- Language: MoonScript
- Homepage:
- Size: 603 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-yue - Yuema - raylib + luajit + YueScript (Game Engines / emacs)
README
# Yuema
Yuema is a Lua-based programming framework combining [raylib](https://github.com/raysan5/raylib) (and some of its accompanying libraries), [Box2D](https://github.com/erincatto/box2d), [LuaJIT](https://github.com/LuaJIT/LuaJIT) and [Yuescript](https://github.com/pigpigyyy/Yuescript) into a stand-alone executable with minimal external dependencies.
You can use it to write 2D and 3D games in [Lua](https://www.lua.org/) or [Yuescript](http://yuescript.org), a [MoonScript](https://moonscript.org/) derivative that compiles to Lua. Yuescript integration is seamless with no extra compilation step required.




## Work in progress!
The API is not stable and will change frequently.
## How to build
Make sure you clone with submodules:
git clone --recurse-submodules git@github.com:megagrump/yuema.git
### Linux
#### 1. Install dependencies
Debian based (Ubuntu, etc.)
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
RedHat based (Fedora, etc.)
sudo dnf install alsa-lib-devel mesa-libGL-devel libX11-devel libXrandr-devel libXi-devel libXcursor-devel libXinerama-devel
CMake is required also.
#### 2. Build
```
mkdir build
cd build
cmake ..
make
```
### Windows
The [MSYS](https://www.msys2.org/) MinGW compiler suite is used to create binaries for Windows. Additionally, `mingw-w64-x86_64-cmake` is required to build the project.
The `/mingw64/bin` directory is expected to be in your `$PATH`.
```
mkdir build
cd build
cmake -G "MSYS Makefiles" ..
make
```
### Other platforms/compilers
No one has tried yet.
## Examples
Some examples can be found in the `examples` directory.
```
./build/yuema examples/gui_controls.yue
./build/yuema examples/core_3d_camera_first_person.yue
./build/yuema examples/models_mesh_picking.yue
./build/yuema examples/box2d_joints.yue
```
You **must** run the examples from the project root.
# How to make your own game with yuema
You currently have to manually bootstrap new projects, but it's simple:
1. Build yuema or download a binary release.
2. Create a new directory for your project, for example `/home/alice/myproject` or `C:\projects\myproject`.
3. Copy the yuema executable (`yuema` or `yuema.exe` on Windows) to the project directory and rename it, for example `myproject` (or `myproject.exe`).
4. Copy the `lib` directory to the project directory.
5. Create a `main.lua` or `main.yue` file in the project directory. This is your project's entry point.
```
myproject <-- project directory
/lib <-- library code
main.yue <-- code entry point
myproject(.exe) <-- executable
```
You can run your project by starting `myproject` from the project directory.
## Code and libraries used in this project
* raylib: https://github.com/raysan5/raylib Copyright (c) 2013-2022 Ramon Santamaria
* raygui: https://github.com/raysan5/raygui Copyright (c) 2014-2022 Ramon Santamaria
* Box2D: https://github.com/erincatto/box2d Copyright (c) 2019 Erin Catto
* LuaJIT: https://github.com/LuaJIT/LuaJIT Copyright (C) 2005-2022 Mike Pall
* Yuescript: https://github.com/pigpigyyy/Yuescript Copyright (c) 2021 Li Jin
* luautf8: https://github.com/starwing/luautf8 Copyright (c) 2018 Xavier Wang
* CParser: https://github.com/facebookresearch/CParser Copyright (c) Facebook, Inc. and its affiliates.