- Clone the repo and install the dependencies.
git clone https://github.com/tarasyarema/tensorblock.git
cd tensorblock
npm install
- If you want to run it locally you'll need to install MongoDB so go here to do so.
After installing MongoDB create a folder
/data
, start and run it in the repo directory. After this the database should be running fine.
mkdir data
sudo service mongod start
mongod --db_path=data
- Run the app. By default the server is listening on port 3000. Go to http://localhost:3000 to test the app in your browser.
node index.js
Create a new file named /static/js/levels/file<id>.js
. The format is the next:
const level<id> = {
"platforms": [[]],
"portals": [[]],
"exit": [],
"init": [],
"hor_bar": [],
"ver_bar": [],
"spikes_lever": [],
"id": <id>
};
Array of all the platforms in the level. The format of the platform is [x,y,w]
where x,y
is the postion of the platform and w
is the width.
Same format as platforms
.
The format is [x,y]
of the position.
Same format as exit
.
Array of the horizontal bars that can be moved by the player. Same format as platforms
.
Array of the vertical bars that can be moved by the player. Same format as platforms
.
Array of the spike platforms. Not yet implemented.
It could be any type but currently we are using integers.
We are working on creating some test for new levels. Before that we will check them manually and then merge them to master.
MONGOLAB_URI=mongod://<user>:<password>@host:port/database_name
NODE_ENV=<state>
If NODE_ENV=development
the server will use a mongodb://localhost:27017/hack
database, so you should have a mongo server running.
If NODE_ENV=production
the server will use the production database as it uses the page tensorblock.tech, if you have access to it.
NODE_ENV=production node index.js
The game is deployed using Heroku and mLab.