Skip to content

Instantly share code, notes, and snippets.

@IceDragon200
Last active August 29, 2015 14:20
Show Gist options
  • Save IceDragon200/4552440f77478222d155 to your computer and use it in GitHub Desktop.
Save IceDragon200/4552440f77478222d155 to your computer and use it in GitHub Desktop.

We'll make a project. Make a new directory somewhere Put:

# mruby-moon load
engine = Moon::Engine.new do |e, delta|
  step e, delta
end
 
engine.setup
 
require 'core/load'
require 'scripts/load'
 
engine.main

Into a file, (call it main or something)

and then run the mruby interpter from moon

mruby main.rb

It should try to load a Moon like project.

Create a scripts and core directory each with a load.rb for now.

In the scripts/load.rb

def step(engine, delta)
  do_step_stuff_here
end

Normally if you have all the basalt packages installed you can do stuff like this:

def step(engine, delta)
  @state_manager ||= Moon::StateManager.new(engine).tap do |s|
    s.push States::Title
  end
  @state_manager.step delta
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment