-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpong.json
123 lines (122 loc) · 2.17 KB
/
pong.json
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
[
{
"name": "canvas",
"transform": {
"width": 512,
"height": 384
},
"canvas2d": {
"htmlTarget": "canvas",
"background": "#000"
},
"audiolistener": {}
},
{
"name": "background",
"parent": "canvas",
"transform": {},
"shape2d": {
"fill": "#fff",
"lineWidth": 4,
"lineDash": [16, 4],
"path": "m 256,0 v 384"
}
},
{
"name": "ball",
"parent": "background",
"transform": {
"x": 256,
"y": 192,
"width": 32,
"height": 32
},
"shape2d": {
"fill": "#fff",
"path": "m -16,0 a 16,16 0 1,1 32,0 a 16,16 0 1,1 -32,0 z"
},
"pong/ball": {
"speed": 200,
"player1": "paddle1",
"player2": "paddle2"
}
},
{
"name": "paddle1",
"parent": "background",
"transform": {
"x": 16,
"y": 192,
"width": 32,
"height": 128
},
"shape2d": {
"fill": "#fff",
"path": "m -16,-64 h 32 v 128 h -32 z"
},
"pong/player": {
"up": "KeyW",
"down": "KeyS",
"speed": 200,
"score": "score1"
},
"audiooscillator": {
"type": "square",
"frequency": 262
}
},
{
"name": "paddle2",
"parent": "background",
"transform": {
"x": 496,
"y": 192,
"width": 32,
"height": 128
},
"shape2d": {
"fill": "#fff",
"path": "m -16,-64 h 32 v 128 h -32 z"
},
"pong/player": {
"up": "ArrowUp",
"down": "ArrowDown",
"speed": 200,
"score": "score2"
},
"audiooscillator": {
"type": "square",
"frequency": 440
}
},
{
"name": "score1",
"parent": "background",
"transform": {
"x": 128,
"y": 16
},
"text2d": {
"text": "0",
"align": "center",
"baseline": "top",
"font": "64px Impact, Charcoal, sans-serif",
"fill": "#fff"
}
},
{
"name": "score2",
"parent": "background",
"transform": {
"x": 384,
"y": 16
},
"text2d": {
"text": "0",
"align": "center",
"baseline": "top",
"font": "64px Impact, Charcoal, sans-serif",
"fill": "#fff"
}
}
]