diff --git a/client/clientDisplay.js b/client/clientDisplay.js index 6d9d7d6..b07e8c4 100644 --- a/client/clientDisplay.js +++ b/client/clientDisplay.js @@ -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', diff --git a/client/clientSocket.js b/client/clientSocket.js index fe86e0d..947e770 100644 --- a/client/clientSocket.js +++ b/client/clientSocket.js @@ -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); }