Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fairfieldt/xcjs
xc.js - Javascript framework for cross platform 2d games
https://github.com/fairfieldt/xcjs
Last synced: about 2 months ago
JSON representation
xc.js - Javascript framework for cross platform 2d games
- Host: GitHub
- URL: https://github.com/fairfieldt/xcjs
- Owner: fairfieldt
- License: other
- Created: 2010-09-10T10:38:27.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2014-07-14T21:45:55.000Z (about 10 years ago)
- Last Synced: 2024-06-20T12:25:46.823Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 37.6 MB
- Stars: 129
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
xc.js - a Javascript framework for cross platform 2d games
==========================================================**This project is not maintained.**
If you're interested in a cross platform JavaScript game framework, check out the [GameClosure Devkit](http://github.com/gameclosure/devkit)
Building xc.js
--------------
xc.js requires [node.js](http://www.nodejs.org), [coffeescript](http://jashkenas.github.com/coffee-script/) (0.9.5 or later), and [Ruby](http://www.ruby-lang.org/) for the build utility.From the root directory, run cake:
$ cake build
xc.js built.You can also run some unit tests:
$cake testUsing xc.js
-----------To create an xc.js project, use the xc.rb utility:
`$ ruby xc.rb myProject create`
will create a directory named myProject. The directory contains:myProject/
lib/
resources/
config.xc
index.html
main.js
xc.rbThe **lib** directory contains the xc.js framework.
The **resources** directory is where images and other media are stored. Images put in the resources directory will automatically be added to an xc.js project.
**config.xc** is the project configuration file. You can specify a resolution when creating a project by appending it to the create command `myProject create 800x600`. If you don't, you can change the resolution in config.xc.
**index.html** is the file where your canvas game will be loaded. It is automatically updated whenver you run the development server so any new resources or other changes will automatically be available.
**main.js** is the entrypoint of your xc.js game. It contains the main() function, which will be called to start the game.
xc.rb is a utility you can use to do various tasks. The most useful is
`$ ruby xc.rb server`
which will start a development server. You can then access your xc.js project with a webrowser at localhost:8000.Adding a new backend
--------------------
xc.js is designed to be easy to port to new platforms. All that is required is a new xc_platform.coffee file for the new platform. Platform compat source is in the src/compat directory.The canvas implementation, in `xc_canvas.coffee` is documented and should provide a good starting point for a new backend.