-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreceiver.html
38 lines (32 loc) · 1.32 KB
/
receiver.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<html>
<head>
<title>Chromecast battleship game receiver</title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js"></script>
<script type="text/javascript" src="receiver.js"></script>
<script type="text/javascript" src="board.js"></script>
</head>
<body>
<textarea id="textarea" rows="20" cols="70">
Hellow world!!
</textarea>
<script type="text/javascript">
window.onload= function(){
// init cast receiver
window.castReceiver=new CastReceiver();
// init player counter, use for dispatch player 1 or player 2
window.playerCount=0;
// init counting the set ship completion player.
window.playerSetShipCompleteCount=0;
// record which player's turn.
// 1 : player1, 0 : player2
window.playerTurn=0;
// init game board UI
window.b1=new Board();
window.b2=new Board();
// Only init the object, draw it until two player set ship complete.
window.boardui=new BoardUI(b1, b2);
};
</script>
</body>
</html>