An open API service indexing awesome lists of open source software.

https://github.com/tarasyarema/tensorblock

Crazy multi-timeline platform game.
https://github.com/tarasyarema/tensorblock

blockchain express game mongoose tensorflow threejs

Last synced: 5 months ago
JSON representation

Crazy multi-timeline platform game.

Awesome Lists containing this project

README

          

# TENSORBLOCK.js

## Install and run

1. Clone the repo and install the dependencies.

```
git clone https://github.com/tarasyarema/tensorblock.git
cd tensorblock
npm install
```

2. If you want to run it **locally** you'll need to install [MongoDB](https://www.mongodb.com/) so go [here](https://docs.mongodb.com/manual/administration/install-community/) 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
```

3. Run the app. By default the server is listening on port 3000. Go to [http://localhost:3000](http://localhost:3000) to test the app in your browser.
```
node index.js
```

## Request new levels

Create a new file named `/static/js/levels/file.js`. The format is the next:

```javascript
const level = {
"platforms": [[]],
"portals": [[]],
"exit": [],
"init": [],
"hor_bar": [],
"ver_bar": [],
"spikes_lever": [],
"id":
};
```

### `platforms` : platforms.
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.

### `portals` : temporal portals.
Same format as `platforms`.

### `exit` : exit (finish) portal.
The format is `[x,y]` of the position.

### `init` : initial position.
Same format as `exit`.

### `hor_bar` : horizontal bars.
Array of the horizontal bars that can be moved by the player. Same format as `platforms`.

### `ver_bar` : vertical bars.
Array of the vertical bars that can be moved by the player. Same format as `platforms`.

### `spikes_lever` : `null`
Array of the spike platforms. **Not yet implemented**.

### `id` : id of the level.
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.

## Dev

### The `.env` file

```
MONGOLAB_URI=mongod://:@host:port/database_name
NODE_ENV=
```
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](http://tensorblock.tech), if you have access to it.
```bash
NODE_ENV=production node index.js
```

### Deploy

The game is deployed using Heroku and mLab.

## TODO

- [ ] Tests for levels [#issue3](https://github.com/tarasyarema/tensorblock/issues/3)
- [ ] Level maker/editor [#issue4](https://github.com/tarasyarema/tensorblock/issues/4)