Simple template project for making an application that uses Myou Engine.
Go to file Use this template
2024-08-29 00:47:51 +02:00
assets First commit. 2024-08-23 17:08:24 +02:00
build/web First commit. 2024-08-23 17:08:24 +02:00
scripts Fix typo in watch.sh that broke it. Add arguments to pass to the compiler. 2024-08-29 00:47:51 +02:00
src First commit. 2024-08-23 17:08:24 +02:00
.gitignore First commit. 2024-08-23 17:08:24 +02:00
nim.cfg First commit. 2024-08-23 17:08:24 +02:00
README.md First commit. 2024-08-23 17:08:24 +02:00

Template project for Myou Engine

Features

  • A nim.cfg ready to compile to desktop, Android, iOS, and web through Emscripten.
  • Helper scripts for using the C files for Android and iOS (in Android Studio and XCode respectively).
  • A game.html file with just a canvas that fills the whole window.
  • A simple python server that supports CORS (so you can load assets remotely), and COOP/COEP (so multithreaded Emscripten builds can work).
  • An empty example.blend that is just a default cube saved in Blender 4.1.

How to use

  • Have the code of Myou Engine somewhere. In this example it expects it to be in ../myou-engine (that is, in the parent folder of this project).

  • If you have the engine somewhere other than ../myou-engine, change the path in nim.cfg. For example, if you have it in ./libs/myou_engine, then change this:

    path:"../myou-engine/libs/packages"

    by this:

    path:"./libs/myou_engine/libs/packages"

    Note that we add /libs/packages so that the engine can use all of its dependencies without relying on a package manager.

  • Have Nimskull installed in your path (here we'll assume it's just nim). In the future it will work with Nim (and other languages as well) through a built version of the engine.

Desktop version

  • To compile and run for desktop just run

    nim c -r src/main.nim

    The output will be in build/game.exe or build/game.

  • To compile a Windows version from Linux or MacOS, run:

    nim c -d:mingw src/main.nim

    You can add -r to run it, it will try to use Wine if you have it installed.

Web version

Mobile version

  • To compile it for Android:

    nim c --os:android --cpu:arm64 src/main.nim

    Output C files will be in tmp/android/

    (TODO: instructions on how to use files in Android Studio)

  • To compile it for iOS:

    nim c --os:ios src/main.nim

    Output C files will be in tmp/android/

    (TODO: instructions on how to use files in XCode)

License

Add your own license and replace this text. Until then you can consider this CC0. You can use the files in this repository for any purpose whatsoever.