pixi integration is improving

This commit is contained in:
2020-12-14 23:07:03 +01:00
parent c194164e3c
commit 965b7a5ad7
4 changed files with 76 additions and 35 deletions

View File

@ -22,6 +22,7 @@
<script src="//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<script>
window.the_game = null
// let socket = new WebSocket("wss://cowiz.struppi.name/ws");
if (window.location.hostname == '127.0.0.1') {
ws_schema = 'ws://';
@ -36,9 +37,13 @@
//alert("[open] Connection established");
//alert("Sending to server");
//socket.send("My name is John");
let player = "{{player}}"
var msg = {
//type: "message",
//fct: "requestInit",
type: "message",
fct: "requestInit",
fct: "getHand",
player: player,
};
let t = JSON.stringify(msg);
window.game_socket.send(t);
@ -50,10 +55,19 @@
if (fct == "reload") {
location.reload(true);
}
else if (fct == "getHand") {
window.hand = msg.cards;
var msg_out = {
type: "message",
fct: "requestInit",
};
let t = JSON.stringify(msg_out);
window.game_socket.send(t);
}
else if (fct == "startGame") {
let names = msg.names
setupGame(names)
alert('game is set up')
setupGame(names, window.hand)
//alert('game is set up')
}
else {
alert('unknown command: '+event.data);