Diff of /examples/templated-game/resources/game-data.exjson [000000] .. [cdc45d] Maximize Restore

  Switch to unified view

a b/examples/templated-game/resources/game-data.exjson
1
/*
2
3
ExJson formatted file.  This is a custom extension of Json that includes:
4
    * keys and values can be strings without quotes.
5
    * You can make references to other objects, and make an object
6
        referenciable.
7
    * block and line comments, ala JavaScript.
8
    * multiple number interpretations ('_' in the middle of a number, ala
9
        Java 7, different prefixes (0x, 0b, 0o) to represent different
10
        radix)
11
    * Parenthesis contain a numeric expression that will be evaluated.
12
    * Angle brackets for 2 dimensional numeric data.
13
    * Support for parsing a string as a boolean.
14
    * line ends don't need comma separators, but both commas and semicolons
15
        are supported.
16
*/
17
18
19
{
20
    // static object - the template processor will add these to the available
21
    // constants
22
    $static: true
23
24
    int: [
25
        // int keyword: interpret all in this list as an integer constant
26
        // named by the referent object.
27
        @COLOR_BLACK
28
        @COLOR_BLUE
29
        @COLOR_RED
30
        @COLOR_GREEN
31
        @COLOR_ALPHA
32
    ]
33
}
34
35
36
{
37
    // Color data
38
    type: color,
39
40
    BLACK:  *COLOR_BLACK 0x000000,
41
    BLUE:   *COLOR_BLUE 0x0000ff,
42
    RED:    *COLOR_RED 0xff0000,
43
    GREEN:  *COLOR_GREEN 0x00ff00,
44
    ALPHA:  *COLOR_ALPHA 0x888888,
45
}
46
47
48
{
49
    // bitmap data
50
    type: bitmaps
51
52
    bitmaps: [
53
        *ENEMY1 < // list of lists
54
        0 1 0 0 1 0,
55
        1 1 1 1 1 1,
56
        1 0 1 1 0 1,
57
        0 1 0 0 1 0,
58
        0 0 1 1 0 0,
59
        >
60
        *ENEMY2 <
61
        0 0 1 0 0 0,
62
        0 1 1 1 0 0,
63
        1 1 0 1 0 1,
64
        1 1 0 1 0 1,
65
        0 1 1 1 1 1,
66
        >
67
    ]
68
}
69
70
{
71
    type: units
72
73
    units: [
74
        {
75
            $alias: [ UNIT_0_POS, UNIT_ALIEN ]
76
            hp: 600
77
            maxMovement: 50
78
            color: @COLOR_RED
79
            image: @ENEMY1
80
        }
81
82
        {
83
            $alias: [ UNIT_1_POS, UNIT_SNAIL ]
84
            hp: 10
85
            maxMovement: 1
86
            color: @COLOR_BLUE
87
            image: @ENEMY2
88
        }
89
90
        {
91
            $alias: [ UNIT_2_POS, UNIT_SAILBOAT ]
92
            hp: 100
93
            maxMovement: 20
94
            color: @COLOR_GREEN
95
            image: @ENEMY2
96
        }
97
    ]
98
}