0.1.8 • Published 5 years ago
sinix v0.1.8
Sinix
Build games for Sinix with Joystick support
Installation and Setup
$ npm install sinix --saveAdd script in package.json
"scripts": {
"sinix": "sinix",
}Initialize a Sinix project
$ npm run sinix initThis will create sinix.config.js in the current directory. By default, sinix packages
the content of dist/ directory, update the distDir value in sinix.config.js
as per your project.
Communication Interface
You can use remote to listen for events happening on Joysticks
import { remote } from "sinix"
remote.listen("STICK1", (payload) => {
console.log(payload)
/*
{
"user": "nickname",
"x": 35.09090909090909,
"y": -48.36363636363637}
}
*/
})
remote.listen("BUTTON", (payload) => {
console.log(payload) // { "user": "nickname", "val": "A" }
if(payload.val === "A"){
// do something
} else if(payload.val === "B"){
// do something
}
})Build and Publish
Generates app.dext file in release folder, which you can open in Sinix
or publish on Sinix.
$ npm run sinix buildIt is also possible to publish directly from the command-line using following command.
$ npm run sinix publishwill prompt for token and password which can be retrieved from the account created on sinix.dev. The application
will go live in under 24 hours on Sinix Store.