神刀安全网

XMoto.js

XMoto.js

DEMO

This project is a HTML5 Port of XMoto using CoffeeScript , 2D Canvas and Box2DWeb .

XMoto.js

This is the first part of a 2-parts project:

  1. XMoto.js (this project!): JavaScript port of the game that need to be compatible with a lot of pre-existing levels (XML files) from the original game.
  2. XMoto.io: social XMoto game with a backend for scores, replays, etc.

XMoto.io will be built on top of XMoto.js, using Ruby on Rails, and both the projects will co-evolve and interact in some parts.

More about the project development on http://xmoto.io

Demo

Master branch is frequently deployed here: http://js.xmoto.io

Click on the "debug mode" button and have fun with the simulation parameters. You can copy-paste the generated URL to keep the custom physics.

Examples: Tractor , Rodeo , Ugly Mode , Big Head , Moon , Furious

Usage

  • Upload "data", "lib" and "bin" folders on a static web server (put ‘data’ folder on the root directory)
  • Include all the JavaScript files of /lib/ and /bin/xmoto.js on your web page.
  • Call $.xmoto('l1.lvl') or $.xmoto('l1.lvl', options) where "l1.lvl" is the name of the level and the options are:
{   canvas:  '#xmoto'   # canvas selector   loading: '#loading' # loading selector   chrono:  '#chrono'  # chrono selector } 

Developpment

Installation

  • brew install nodejs : install NodeJS (on MacOS)
  • sudo npm install -g coffee-script : install CoffeeScript
  • npm install express : install Express

Working environnement

  • coffee -j bin/xmoto.js -wc src/*.coffee src/*/*.coffee to compile to JavaScript in real-time.
  • node server.js to launch HTTP Server (http://localhost:3000).

Don’t forget to restart the coffee command if you create new COFFEE files.

TODO

Improve XML levels compatibility!

and other stuffs

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » XMoto.js

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮