Skip to content

Instantly share code, notes, and snippets.

@parzibyte

parzibyte/dom.js Secret

Created November 2, 2020 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/ba170f8e821e5e176b9d8618c3a271f0 to your computer and use it in GitHub Desktop.
Save parzibyte/ba170f8e821e5e176b9d8618c3a271f0 to your computer and use it in GitHub Desktop.
initDomElements() {
this.$canvas = document.querySelector("#" + this.canvasId);
this.$score = document.querySelector("#puntaje");
this.$btnPause = document.querySelector("#btnPausar");
this.$btnResume = document.querySelector("#btnIniciar");
this.$btnRotate = document.querySelector("#btnRotar");
this.$btnDown = document.querySelector("#btnAbajo");
this.$btnRight = document.querySelector("#btnDerecha");
this.$btnLeft = document.querySelector("#btnIzquierda");
this.$canvas.setAttribute("width", Game.CANVAS_WIDTH + "px");
this.$canvas.setAttribute("height", Game.CANVAS_HEIGHT + "px");
this.canvasContext = this.$canvas.getContext("2d");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment