Projektmanagement-Game/public/js/game.js

27 lines
601 B
JavaScript
Raw Normal View History

let app;
window.addEventListener('resize', resize);
window.addEventListener('load', function () {
app = new PIXI.Application({
autoResize: true,
resolution: devicePixelRatio,
backgroundColor: 0x0073db
});
document.getElementById('game').appendChild(app.view);
socket.on('dice', function (data) {
console.log(data);
});
2021-05-26 17:34:31 +00:00
socket.on('card', function (data) {
console.log(data);
});
resize();
});
function resize() {
2021-06-08 05:58:46 +00:00
let game = document.getElementById('game');
app.renderer.resize(game.offsetWidth, game.offsetHeight);
}