• Register

Game engine for MoonScript, in Moonscript. Open Source. Windows, Mac OS X, Linux, Android, iOS and Ouya.

Post news Report RSS Easier coding, better performance, awesome look

In 5.3.0 release of NÖN I totally changed API to similar API as seen in LÖVE. Also, I simplified lifecycle callback and added tons of awesomeness.

Posted by on

Hello everyone :) New update is finally here. I am sure you all 4 watchers eagerly waited for this LOL.
I updated website (again). You can check it here: Non2d.github.io. Also, new logo:

So, stop talking, start showcasing.

I created new super awesome splash screen which now also logs progress.

Here is example of old method of drawing images and text (with resource loading displayed on splash screen):

ruby code:
require "non/graphics"

def init(assets)
  assets.add :image, "nokia_logo.png"
end

def ready
  @image = Graphics.image "nokia_logo.png"
end

def render(dt)
  Graphics.print "What hath Matz wrought?", position: [10, 10]
  Graphics.draw @image, position: [50, 50]
end

And here is same functionality with new API:

ruby code:
@image = NON.graphics.image "nokia_logo.png"

def draw
  NON.graphics.print "What hath Matz wrought?", position: [10, 10]
  NON.graphics.draw @image, position: [50, 50]
end

Awesome right? Same applies to rest of NÖN functionality. Also, added new file API.

Reading from files:

ruby code:
file = NON.files.internal "myfile.txt"
text = file.read_string

Writing to files:

ruby code:
file = NON.files.local "myfile.txt"
file.write_string "My god, it's full of stars"

Also, added support for parsing YAML, JSON and XML files. Small example of parsing YAML:

ruby code:
@file = NON.files.internal "non/config.yml"
@config = NON.files.parse_yaml @file.read_string
puts @config["name"]
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: