Projektmanagement-Game/public/js/game.js
H4CK3R-01 9e054ddd91 - Added dice to server
- Added get random card function to server
2021-06-08 09:34:55 +02:00

27 lines
601 B
JavaScript

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);
});
socket.on('card', function (data) {
console.log(data);
});
resize();
});
function resize() {
let game = document.getElementById('game');
app.renderer.resize(game.offsetWidth, game.offsetHeight);
}