Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

NON - Free 2D Lua and MoonScript Game Engine


YourBestNightmare
 Share

Recommended Posts

  • Replies 146
  • Created
  • Last Reply

Top Posters In This Topic

New update

* Added support for Ruby and Python
* Revamped networking
* Added support for shaders (non.graphics.shader.fromFile etc..)
* Made some bugfixes and tweaks
* Uploaded all source code to GitHub
* Added non.load function what can eval external scripts

Searching for people who will work on this with me, I think with **non** we can concure frameworks such as Love2D etc. If you are interested, PM me.

Source code and download link: [GitHub](https://github.com/deathbeam/non)

Source code is licensed under MIT license, so devs have almost full freedom :)

Example of main.lua:

```
local map, pressed, testText, client, server, lastMsg
non:load("testText.lua")

non.ready = function()
map = non.tiled:newMap("map.tmx")
non.audio:play(non.audio:newMusic("music.ogg"))
non.network.connected = function(conn)
lastMsg = "client connected: "..conn:toString()
end
non.network.disconnected = function(conn)
lastMsg = "client disconnected"
end
non.network.received = function(data, conn)
lastMsg = "data received: "..data:read()
end
non.network:setHost("localhost"):setPort(15600):init()
server = non.network:newServer()
server:listen()
client = non.network:newClient()
client:connect()
end

non.update = function()
if (non.keyboard:isKeyJustPressed("Space")) then
local buffer = non.network:newBuffer()
buffer:write(1)
client:send(buffer)
else

end
if non.keyboard:isKeyPressed("Space") then
pressed = "Key pressed: Spacebar (release Spacebar to test)"
else
pressed = "Key pressed: None (press Spacebar to test)"
end
end

non.draw = function()
non.graphics:draw(map)
non.graphics:draw("Author: YourBestNightmare", 10, 10, non.graphics:newColor("yellow"))
non.graphics:draw("Engine: non (no nonsense) framework", 10, 34)
non.graphics:draw("Description: In this example we are testing music, input, tmx rendering, images and text displaying.", 10, 58)
non.graphics:draw(pressed, 10, 82, non.graphics:newColor("cyan"))
non.graphics:draw("FPS: "..non:getFPS(), 10, 104)
non.graphics:draw(lastMsg, 10, 126, non.graphics:newColor("red"))
end
```
Link to comment
Share on other sites

> This is looking pretty good yo, I have a question however, i remember seeing you say something about making framework use more than one scripting language, might i ask why? you could just use Lua, which, in my opinion is the easiest to learn. lol

Becouse some people are skilled in that, some people in that. Yes, Lua is easy to learn, but for some people JavaScript is easier and for some Python is easiest. And, it do not hits performance at all, so why not? Why not let people decide what language they should use? :)
Link to comment
Share on other sites

> Excuse me, I forgot the comma, "Why not, Grow?"
>
> Meaning, "Why not adding more shiet, Growlith?"
>
>   :P

Oh :D

New update

I finished examples for

* TypeScript

* CoffeeScript

* Lua

* JavaScript

I also fixed bug where non was not able to find non.cfg configuration

while in same directory as launcher. And, fixed shaders. Also, added 2

new events:

* non.resize

* non.close

Here is full details of this update: [GitHub](https://github.com/deathbeam/non/commit/eb4699eae8619f63a6ca0f10ed3a54c4dbfd74e1)
Link to comment
Share on other sites

> Not to drizzle on the parade but for at least libGDX you need to throw their [license](https://raw.githubusercontent.com/libgdx/libgdx/master/LICENSE) into your root or libs directory. I imagine the other dependencies you have also need their licenses included.

Hmm not thought about that but will do when I will have some time to collect them :D

Working on implementation of Groovy, hopefully it will work.

EDIT: Finished with it, now non also supports Groovy :) Full details: [GitHub](https://github.com/deathbeam/non/commit/dd6fd16e9d7ad54bb8fefac40c8b0a7832c80f03)
Link to comment
Share on other sites

Updated website, and created new logo for non.
[Website](http://deathbeam.github.io/non/)

New logo:
![](http://deathbeam.github.io/non/img/logo.png)

EDIT: I created screen what will display when no game data folder is found. Also, created new logo, splash and icons for non and 

updated readme a bit and organized imports.

For more details, check [GitHub commit](https://github.com/deathbeam/non/commit/d5cdb86fb6050c1cdc2afdf8b1fa225fc15bc621)

![](http://eclipseorigins.com/community/filehost/6a85b4551525fadd5a6cdbf4bed736ef.png)
Link to comment
Share on other sites

Thanks Sacra :) And you know… I am not best at English :D Btw, new update:

Added physics engine :) Based on Box2D and currently supports polygons, rectangles and circles. More shapes planned soon. Also, you can create physics from TiledMap objects (WIP).

View full details on [GitHub](https://github.com/deathbeam/non/commit/32acf4f877f11b82b688ae41e8c7c66f43ecabfe)

Example how easy is to initialze physics and create shapes:

```
non.physics.setTimeScale(2).setGravity(non.math.newVector(0, 10)).init();
non.physics.newShape(non.math.newRectangle(32,10,20,20));
non.physics.newShape(non.math.newRectangle(100,10,20,20));
non.physics.newShape(non.math.newRectangle(0,150,20,20), "static");
non.physics.newShape(non.math.newRectangle(0,300,300,20), "static");

```
Image of physics in action:

![](http://eclipseorigins.com/community/filehost/08d57b6edfc1d75b9d5aca59663887c5.png)
Link to comment
Share on other sites

New update

* Added support for density, friction and restitution to physics engine

* Drastically increased script engine performance

* Added light engine

For more info, check [GitHub](https://github.com/deathbeam/non/commit/7f00f10e0aa4b332468ee9d8aced433b8737c7b1)

Below is demo image for directional and ambient lighting:

![](http://eclipseorigins.com/community/filehost/90363e83a61b66160aa8741e4f1fdc9e.png)
Link to comment
Share on other sites

> Looks good, man. I'm not pointing fingers, but I will say that I hope you're doing the right thing if you're using code from other projects, which you yourself alluded to with Box2D, and are accrediting them.
>
> Keep it up. :)

I am not using code from other projects, only java libraries. Only code that I used from "other projects" is MapBodyLoader class what is from tutorial from StackOverflow. But if you are saying that I am wrapping all code of libraries that I am using then yes, that is true becouse I want to ensure cross-language compatibility and I am highly focusing on using method chaining, what most of libraries I am using do not supports at all :/

Here is libraries that I am using:

* JRuby
* LuaJ
* Jython
* Groovy
* ZT-Zip (with some changes)
* Mozilla Rhino (yes, I know that it is by default with java 1.6, but in 1.8 there is nashorn, what I do not like)
* LibGDX
* LibGDX Box2D
* LibGDX Box2DLights

EDIT: I started working on wiki and added "Thank you" to libraries what I am using [here](https://github.com/deathbeam/non/wiki/Introduction).
Link to comment
Share on other sites

New update

In this update I added cone lights and updated light engine a bit and

also examples. Also added license files for some used libraries.

To view details of this update, view Github commit [here](https://github.com/deathbeam/non/commit/129ad6dd1664445ff87cc07f3e23ee6b3ab864cb).

Here is screenie of updated light engine:

![](http://eclipseorigins.com/community/filehost/aed03339d46dcba1fc486b35d57bfe70.png)
Link to comment
Share on other sites

> Better off just providing a URL to their website or page.

Not when, based on their license, you are legally required to provide a copy of their license. Since the project is now using Gradle I think it _may_ be a non-issue now though.

Edit: Gradle License Task [http://stackoverflow.com/questions/24280284/list-all-gradle-dependencies-with-their-licences](http://stackoverflow.com/questions/24280284/list-all-gradle-dependencies-with-their-licences)
Link to comment
Share on other sites

Another update:

- Added fixed timestep for physics updating

- Updated buildAssets gradle task with new features

- Added new gradle enviroment variable setting APP_NAME what defines application name when built (not same as "title" in non.cfg")

I also started working on easy function what will sync physics over network. If I will succeed, it will be awesome :P This is also reason why I added fixed timeStep.

Now I am thinking about removing non.cfg file and using only "local.properties" and gradle for defining main script and removing resolution setting and adding setResolution method to non.
Link to comment
Share on other sites

I was working on gradle implementation and got inspired a lot from Roboto command line tools.

* Removed 'buildAssets' task and replaced it by 'update' task in each subproject, so you can do for example: 'non desktop:update' or 'non android:update' to update assets from your '/project' directory to relevant asset folder before compiling.

* Replaced some weird gradle task naming not same for all subprojects, so now you can use ':dist' and ':run' task on all projects same for packaging and running different platform projects

* Added 'gen' task, what will generate Hello World project for language you specify. Example usage 'non gen js' for generating JavaScript Hello World project for non. Language is specified by language file extension, so ts is TypeScript, coffee is CoffeeScript, rb is Ruby etc etc. Before using 'gen' task, you must specify enviroment variable ANDROID_HOME what is directory of Android SDK.

Ofc, all above commands must be executed from command line.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...