Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions client/clientDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ export class clientDisplay {
//Methods from this class are called from clientGame.js upon game-state changes.
constructor(gameState) {
//These DOM calls are temporary, as we will be switching to data-targets!
this.gameMessage = document.querySelectorAll('*[data-game-message]')[0]; // These indexes mean there's no flexibility for now, as we need to wrap
this.secretWord = document.querySelectorAll('*[data-secret-word-container]')[0]; // Used by the code to calculate, may as well be a variable.
this.testt = document.querySelectorAll('[data-secret-word-display]')[0]; // Visible to user
this.userGuesses = document.querySelectorAll('*[data-user-guesses]')[0];
this.onlinePlayers = document.querySelectorAll('*[data-online-players]')[0];
this.guessInput = document.querySelectorAll('*[data-guess-input]')[0];
this.usernameInput = document.querySelectorAll('*[data-username-input]')[0];
this.guessSubmit = document.querySelectorAll('*[data-guess-submit]')[0];
this.usernameSubmit = document.querySelectorAll('*[data-username-submit]')[0];
this.gameMessage = document.querySelector('*[data-game-message]'); // These indexes mean there's no flexibility for now, as we need to wrap
this.secretWord = document.querySelector('*[data-secret-word-container]'); // Used by the code to calculate, may as well be a variable.
this.testt = document.querySelector('[data-secret-word-display]'); // Visible to user
this.userGuesses = document.querySelector('*[data-user-guesses]');
this.onlinePlayers = document.querySelector('*[data-online-players]');
this.guessInput = document.querySelector('*[data-guess-input]');
this.usernameInput = document.querySelector('*[data-username-input]');
this.guessSubmit = document.querySelector('*[data-guess-submit]');
this.usernameSubmit = document.querySelector('*[data-username-submit]');
this.bodyParts = ['Head',
'Torso',
'Right_Arm',
Expand Down
1 change: 0 additions & 1 deletion client/clientSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var socket = io('http://localhost:5000');
var clientGame = require('./clientGame.js').clientGame;
var game = null;


export function setUsername(username) {
socket.emit('setUsername', username);
}
Expand Down