Skip to content

The scripting language for the (future) Hobby game engine

License

Notifications You must be signed in to change notification settings

hobby-engine/hobby-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hobby Script

A dynamically typed programming language designed for use in game development. Hobby Script is designed for use in the future Hobby Game Engine, although it is standalone as well.

Features

  • Lack of OOP
  • Speed
    • faster than Wren and Python, slower than Lua (on my machine)
  • Dynamic typing

Building

It should be as easy as cloning the repo and going:

mkdir bin
make

Requires MinGW on Windows.

Snippets

Hello world:

io:print("Hello, world!");

Here's timer, so you can get a better feel for the language:

// Timer.hby
struct Timer;

var total_time = 0;
var time_left = 0;

static fn new(total_time) -> Timer{total_time=time};

fn is_over() -> self.time_left <= 0;
fn step(dt) {
  self.time_left -= dt;
}

Then, you can use it in some other file like this:

// main.hby
var Timer = import("Timer.hby");

var timer = Timer:new(5);
timer.step(1);