This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SAT from 'sat' | |
// Size of each memory pool | |
const POOL_SIZE = 100 | |
// Setting this to true will draw a client side | |
// representation of the collider shapes | |
const DRAW_COLLIDERS = false | |
// Generators |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import intersects from 'intersects' | |
import { polygonRotate } from 'geometric' | |
const categoryCheck = (c1, c2) => c1.collidesWith.some(category => c2.categories.includes(category)) | |
const reducePoints = points => points.reduce((resultArray, item, index) => { | |
const chunkIndex = Math.floor(index / 2) | |
if (!resultArray[chunkIndex]) resultArray[chunkIndex] = [] // start a new chunk | |
resultArray[chunkIndex].push(item) | |
return resultArray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
properties: | |
scripts: | |
- /game-modes/sandbox/fsm.js | |
- /game-modes/sandbox/start.js |