Table of Contents

MooEngine

Overview

MooEngine was my attempt at creating a 100% scriptable game engine. I was able to integrate all the necessary features by creating a new scripting language called MooScript.

The basic features of MooScript are:

The obligatory Hello World code:

log("Hello World")

Not very exciting, right? :)

Let's make it slightly more interesting:

main : 1000
{
  log("Hello World")
}

The (optional) main function is now automatically called every 1000ms.

Same example, but this time the “Hello World” string is generated by a function:

Function getMessage() : String
{
  return "Hello World"
}

main : 1000
{
  log(getMessage())
}

If you ever wanted to simulate a cow:

Function getMoo(Integer num) : String
{
  return "M" + "o" * num
}

main : 1000
{
  log(getMoo(2 + rand(10)))
}

The output will be:

Moooo
Moo
Moooooo
...

Rather straightforward. Using classes is not very complicated either:

Class Animal
{
  String name
  
  Method talk()
  {
    log("I can't talk")
  }
}

Class Cow : Animal
{
  Bool happy = TRUE
  
  // constructor
  Cow(String n)
  {
    name = n
  }
  
  Method talk()
  {
    if (happy)
      log(name + " 3:-)")
    else
      log(name + " 3:-(")
  }
  
  Method tip()
  {
    happy = FALSE
  }
}

Cow cow1("MadCow"), cow2("BadCow")

cow1.talk()
cow2.tip()
cow2.talk()

The output will be:

MadCow: 3:-)
BadCow: 3:-(

Some of the more interesting features are:

More highlights:

Current State

??% done - stopped

Screenshots

Videos

Video 1: Script Launcher Demonstration

Video 2: Script Editor

Video 3: Mini Games

Video 4: Scripted 3D Scene