add basic game classes
This commit is contained in:
parent
ebcee954bf
commit
bb9a493450
11 changed files with 137 additions and 6 deletions
16
server/game/player.js
Normal file
16
server/game/player.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
const fruit = ['Apple', 'Banana', 'Pear', 'Plum', 'Pineapple', 'Peach', 'Apricot', 'Orange', 'Triangle', 'Kiwi', 'Mango', 'Strawberry', 'Lemon', 'Blueberry', 'Raspberry', 'Grape', 'Dragonfruit', 'Watermelon', 'Honeymelon', 'Pomegranate', 'Cherry', 'Avocado'];
|
||||
|
||||
class Player {
|
||||
constructor(connection) {
|
||||
this.room = false;
|
||||
this.ship = false;
|
||||
this.team = false;
|
||||
this.kickCount = 0;
|
||||
this.connection = connection;
|
||||
this.name = `Stupid $(fruit[Math.random() * fruit.length | 0])`;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Player;
|
Loading…
Add table
Add a link
Reference in a new issue