FROM node:8-alpine
EXPOSE 9000
ENV NODE_ENV=development
ENV APP_ENV=development
WORKDIR /src
COPY package.json /src/package.json
COPY package-lock.json /src/package-lock.json
RUN npm install
COPY config /src/config
COPY app.js /src/app.js
COPY app /src/app
COPY util /src/util
COPY openapi.yaml /src/openapi.yaml
CMD ["node", "app.js"]
port: {
doc: 'port the app is listening on',
format: 'port',
default: 9000,
env: 'PORT',
},
mysql: {
port: {
format: 'integer',
default: 3306,
env: 'MYSQL_PORT',
}
}
}
Моё:
Идеал:
const gameLoop = () => {
requestAnimationFrame(gameLoop);
...
updateAllEntities();
...
cleanupDeadEntities();
}
this.baseFrame = Math.random() * 4;
...
const frame = (gameState.currentTime * 8 + this.baseFrame) & 3;
const i = this.scoreReward ?
(1 - Math.min(1, gameState.currentTime - this.creationTime)) ** 2
: 0;
const s = 16 + gameState.size * i;
ctx.globalAlpha = 1 - i;
ctx.drawImage(
gameState.sprites,
this.sprite * 16, frame * 16, 16, 16,
Math.round(this.x - s / 2), Math.round(this.y - s / 2), s, s
);