-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame_data.js
More file actions
39 lines (34 loc) · 930 Bytes
/
Copy pathgame_data.js
File metadata and controls
39 lines (34 loc) · 930 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
// Made by Dio Arya Raditya.
function defineVariables() {
screenData = {
width: 1000,
height: 1000,
};
screenData.strokeRatio = Math.min(screenData.width, screenData.height) / 1000;
gameData = {
lines: [],
grid: undefined,
cols: 8,
rows: 8,
checkSize: 3,
count: []
};
gameState = {
highlight: true,
ended: () => { return gameState.win || gameState.tie },
win: false,
tie: false,
endState: {
winnerCount: undefined,
loserCount: undefined,
player: undefined // Player that has the most points
}
};
playerData = {
active: 0,
players: 2,
playerColor: [[200, 0, 0], [255, 165, 0]],
playerName: ["Red", "Yellow"],
cyclePlayers: () => { playerData.active = (playerData.active + 1) % playerData.players }
};
}