Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from "react";
- import ReactDOM from "react-dom";
- import "./styles.css";
- const btnEmpezar = document.getElementById("btnEmpezar");
- class JuegoJS {
- constructor() {
- this.inicializar = this.inicializar.bind(this);
- this.inicializar();
- }
- inicializar() {
- // codigo
- }
- siguienteNivel() {
- // codigo
- }
- ganoElJuego() {
- console.log("GANASTE")
- }
- perdioElJuego() {
- console.log("PERDISTE")
- }
- }
- const juego = new JuegoJS()
- function App() {
- return <button
- id="btnEmpezar"
- className="btn-start"
- onClick={juego.inicializar()}>
- Empezar a jugar!
- </button>;
- }
- const rootElement = document.getElementById("root");
- ReactDOM.render(<App />, rootElement);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement