Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/zhenglinlei/stackblock.io

.io minigame
https://github.com/zhenglinlei/stackblock.io

cannonjs game javascript threejs

Last synced: 14 days ago
JSON representation

.io minigame

Awesome Lists containing this project

README

        

> Finding support and maintenance
>
> Collab with us [ISSUES](https://github.com/ZhengLinLei/stackblock.io/issues) and FORK

StackBlock.io







Live web preview [here](https://zhenglinlei.github.io/stackblock.io)


intro pic



Contributing
ยท
Issues



License
ย 

Version


## ๐Ÿ“ Source Code

The main project file code in `./js/script.js`.

This project was made with the help of:

* Three.js
* Cannon.js

CDN:
```HTML

```

## ๐ŸŽฎ Bot testing

To activate the bot testing, you only need to write in console `playBot([relation:float], [time:int])`, by default the parameters are *0.9* and *20ms*

Or you can set it manually:
```javascript
let botTimer = setInterval(()=>{

const lastLayer = stackBoxArr[stackBoxArr.length -1];
const previousLayer = stackBoxArr[stackBoxArr.length -2];

// LAST LAYER DIRECTION
let lastDirection = lastLayer.direction;

// CALCULATE OUTBOX
let delta = lastLayer.threejs.position[lastDirection] - previousLayer.threejs.position[lastDirection] // !NOTE: THE BOTH BOX MUST BE CALCULATED WITH THE SAME DIRECTION
let alpha = Math.abs(delta); // GET POSITIVE NUM

// CALCULATE OUTBOX WIDTH DEPTH
let outbox = (lastDirection === "x")? lastLayer.width : lastLayer.depth;
let inbox = outbox - alpha;

const boxRelation = inbox / outbox; // 0 to 1
if(boxRelation >= 0.9){
document.body.click();

console.log(boxRelation); // OUTPUT
}

}, 20);
```

### Love this repo? Give us a star โญ