Skip to content
Corey Powell edited this page May 10, 2015 · 3 revisions

Getting Started

This small guide will get you started creating a Moon Project.

tl;dr Sample Project

Some boilerplate

Moon is just a glorified mruby interpreter, with all its features as loaded in as mruby gems.

Moon requires quite a bit of setup in order to get started, remember its just an extension of mruby. Luckily, Moon::Engine already knows how to get Moon up and running with a Window and Input events.

A simple bootstrap.rb or main.rb would look like this

engine = Moon::Engine.new do |e, delta|
  # This block will be called each frame
  # Moon::Engine will always pass itself as the first parameter followed by the frame's delta time.
end

# This initializes OpenGL, creates the Window, does all other manner other Moonities.
engine.setup

# This will start the main loop, which will call the block above.
engine.main

Luckily (again), you don't have to write a bootstrap for each project you start, we already provide a bootstrap under moon's scripts directory scripts/bootstrap.rb.

Bin

Several symlinks are available in moon's bin/ directory.

moon-mruby, moon-mirb, moon-mdbg These are shortcuts for their corresponding vendor/mruby/bin/* bin.

moon-player is a nicely wrapped up bash script for calling moon-mruby with moon's script/bootstrap.rb

Its a good idea to add moon's bin path to your PATH

Clone this wiki locally