-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgroups.js
More file actions
32 lines (30 loc) · 1.08 KB
/
groups.js
File metadata and controls
32 lines (30 loc) · 1.08 KB
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
// Groups for all game objects
let player1Group; // player 1
let player2Group; // player 2
let groundGroup; // the ground
let worldBoundsGroup; // invisible borders
let platformGroup; // platforms
let backgroundGroup; // sky, clouds, mountains
let displayScreensGroup; // titlescreen, end game screen
let player1AttackGroup; // hitbox for player 1
let player2AttackGroup; // hitbox for player 2
let portraitsGroup; // Player portraits
let groups = {
createGroups: function() {
// Create phaser groups
player1Group = game.add.group();
player2Group = game.add.group();
player1AttackGroup = game.add.group();
player2AttackGroup = game.add.group();
groundGroup = game.add.group();
worldWrapGroup = game.add.group();
platformGroup = game.add.group();
backgroundGroup = game.add.group();
displayScreensGroup = game.add.group();
portraitsGroup = game.add.group();
// Create
platformGroup.enableBody = true;
worldWrapGroup.enableBody = true;
groundGroup.enableBody = true;
}
};