-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.js
More file actions
50 lines (38 loc) · 711 Bytes
/
constants.js
File metadata and controls
50 lines (38 loc) · 711 Bytes
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
goog.provide('soko.constants');
goog.scope(function() {
var constants = soko.constants;
/**
* Flags for the type of cell.
* @enum {number}
*/
constants.CellTypes = {
WALL: 0x0,
EMPTY: 0x1,
CROSS: 0x2
};
/**
* Directions of movement.
* @enum {number}
*/
constants.Directions = {
UP: 0,
DOWN: 1,
LEFT: 2,
RIGHT: 3
};
/**
* Number of pixels of the block used in rendering.
* @constant {number}
*/
constants.BLOCK_SIZE = 32;
/**
* Max number of blocks in the canvas.
* @constat {number}
*/
constants.MAX_CANVAS_BLOCKS = 12;
/**
* Offsets (for each direction) of movement.
* @constant {!Array.<!Array.<number>>}
*/
constants.DELTAS = [[0, -1], [0, 1], [-1, 0], [1, 0]];
});