Skip to content

Commit aacc885

Browse files
committed
Add GameData#scene
1 parent 9b787c9 commit aacc885

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

js/modules/Celestial.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ export default class Celestial {
3838
this.size = options.size || 0;
3939
this.texture = options.texture || null;
4040
}
41-
}
41+
}

js/modules/GameData.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,25 @@
66

77
/*----- Imports --------------------------------------------------------------*/
88
import { Point, Vector } from "./Utils.js";
9+
import Celestial from "./Celestial.js";
910

1011
/*----- Classes --------------------------------------------------------------*/
11-
/** @module GameData - Manages the game model. */
12+
/** @module GameData Manages the game model. */
1213
export default class {
1314
/** Initialize a game model. */
1415
constructor() {
15-
/** @var {string} id - Short game ID based on the current time. */
16+
/** @var {string} id Short game ID based on the current time. */
1617
this.id = Math.round(+new Date() / 1e3).toString(26);
17-
/** @var {Object} mouse - Data regarding the user's mouse. */
18+
/** @var {Object} mouse Data regarding the user's mouse. */
1819
this.mouse = {
19-
/** @var {boolean} mouse.isDown - Is mouse currently down? */
20+
/** @var {boolean} mouse.isDown Is mouse currently down? */
2021
isDown: false,
21-
/** @var {Object} mouse.initPosition - Position of mouse on down. */
22+
/** @var {Object} mouse.initPosition Position of mouse on down. */
2223
initPosition: new Point(0, 0),
23-
/** @var {Object} mouse.position - Current position of mouse. */
24+
/** @var {Object} mouse.position Current position of mouse. */
2425
position: new Point(0, 0),
2526
};
27+
/** @var {Celestial[]} scene Array of game objects in current scene. */
28+
this.scene = [];
2629
}
2730
}

0 commit comments

Comments
 (0)