OLD | NEW |
| (Empty) |
1 Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
2 for details. All rights reserved. Use of this source code is governed by a | |
3 BSD-style license that can be found in the LICENSE file. | |
4 | |
5 Dartcombat is a sample game which illustrates how to use isolate communication | |
6 and futures. | |
7 | |
8 Building and running: | |
9 | |
10 1. go to the top-level directory of the project: | |
11 $ cd dart/ | |
12 | |
13 2. build the dartc compiler: | |
14 $ ./tools/build.py --arch=ia32 | |
15 | |
16 3. run the htmlconverter tool, that converts the dart code to javascript: | |
17 $ python ./client/tools/htmlconverter.py \ | |
18 client/samples/dartcombat/dartcombat.html -o out/ | |
19 | |
20 4. open the generated file in a browser: | |
21 $ google-chrome out/client/samples/dartcombat/dartcombat-js.html | |
22 | |
23 Using dartcombat: | |
24 | |
25 Dartcombat works as follows: | |
26 - screen: The screen shows 4 grids. On the left is what player1 knows (his board | |
27 in detail, and his partial knowledge of player2's board), on the right is what | |
28 player2 knows. | |
29 | |
30 - setup: You can place boats on the top boards by clicking and dragging the | |
31 mouse. | |
32 | |
33 - shooting: You can shoot by clicking on the bottom grids. To highlight isolate | |
34 communication and futures, we made each click a supershoot: if a boat is hit, | |
35 the player will automatically scan all cells around the initial shot, and | |
36 progresively hit the boat and sink it. | |
OLD | NEW |