2017.11.27 - And there is a game.


You can play simple death matches. You have 10 flakes. Each time one dies, you get a point. There are no win conditions, so the game goes on forever. You can either play against an other human player or against the default script. To create a second player, open a second UI in your browser with the argument ?token=invalid - e.g. http://127.0.0.1:8888?token=invalid. Create then a second user.

User data is not saved yet. If you restart the game, you have to recreate the user. If you choose the same name, you will have access to the previously written scripts of that user. Scripts are executed completely separate from the game, so you need to deploy them first. Scripts written in JavaScript can be executed by your browser. Under code you find all the options on the right hand side.


The documentation for the JavaScript API is located under doc/javascript in your game folder or via [host:port]/doc/javascript/index.html in your browser. de.joschua.reign.BehavedJs is probably the most interesting class for you.

Look for functions and variables with the Annotation @JSExport. That are the functions that you can use. When a function or variable ends on Js, its purpose is just type conversions between Scala and JavaScript types. It is exported without the Js.

Looking at the example code and the API documentation, you should be able to figure everything out. If you want to go into more detail, you can read the Scala.js guide for JavaScript developers and the guide for export to JavaScript.

Files

reign 47 MB
Version 2017.11.27 16 days ago

Get reign

Leave a comment

Log in with your itch.io account to leave a comment.