Tutorial 1 Environment

Ioannis Charalampidis edited this page Jul 27, 2015 · 10 revisions

Virtual Atom Smasher (VAS) is a stand-alone Javascript application, therefore you will need some basic utilities first:

Step 1 - Installing Node.js

Node.js provides the javascript run-time required for some server-side operations, such as building the sources. You can install node.js from here.

Step 2 - Installing LESS compiler

The CSS sources in the project are quite big and messy, therefore we are using less to simplify this process. You will need the lessc compiler. Install it globally in your system using npm from node.js:

$ npm install -g less

Continue to Tutorial 2

For the game core developers

If you are going to create just a game customisation you don't need the following steps, just continue to the next tutorial step

Install a Test Server

VAS will try to download resources dynamically from the web via XHR Requests. Such requests will be blocked if you are browsing the game through the file:/// protocol. Therefore you will need any WebServer capable of serving static files in order to test your sources.

Node.js provides the http-server tool, ready-to-use tool for such purposes. To install it use:

$ npm install http-server -g

LiveQ Back-End

The game itself connects to a LiveQ back-end that provides the low-level, server-side logic. Setting-up an instance might be tedious, so you could use the production endpoint (unless you are implementing core logic functions).

The endpoint is ws://test4theory.cern.ch/vas/api/io. If you want to use that, open your src/modules/vas/config-debug.js and change the following line accordingly:

	 * API to LiveQ
	'core' : {
		'socket_url' : 'ws://test4theory.cern.ch/vas/api/io'


You are now ready to test your set-up. Change directory to src and run:

$ cd src/
$ http-server -c-1

You can now test the game under the url

If you encounter any problem, the javascript console is your friend. Right click on the website and click 'Inspect Element', then switch to the 'Console' tab. Refresh if it's needed.

Ps. The -c-1 option disables cache, which is particularly useful in this case since browsers tend to aggressively cache static resources.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.