-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.js
More file actions
43 lines (35 loc) · 721 Bytes
/
Player.js
File metadata and controls
43 lines (35 loc) · 721 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
var Player = function (startX, startY) {
var x = startX,
y = startY,
size = 70,
id;
var getX = function () {
return x;
};
var getY = function () {
return y;
};
var getSize = function () {
return size;
};
var setSize = function (value) {
size = value;
};
var setX = function (newX) {
x = newX;
};
var setY = function (newY) {
y = newY;
};
// Define which variables and methods can be accessed
return {
getX: getX,
getY: getY,
getSize: getSize,
setSize: setSize,
setX: setX,
setY: setY,
id: id
}
};
exports.Player = Player;