Creating the playable game

Install dependencies

Switching to the game interface will need some prerequisites. If you take a look into the game’s index.html from the resousces, it uses a <script> which assures the mechanics. Working with React will imply using React-Helmet. Please run in your command prompt the following line:

npm install react-helmet-async // check which version install and use that one in the tutorial

Insert the game mechanics

This will allow us to use the <Helmet> tag, and by using it to access the application’s <head> tag. This will make possible for us to insert the script into the main application’s <HTML> structure.

From the game folder:

Let’s copy the images folder to src directory.

We will need the game.js into the public directory to make it accessible calling it inside PlayGame using React-Helmet.

We will need nft_basic.png image into the public folder.

Let’s adapt the index.html from resources to our PlayGame component. The result should look like this:

import assets from '../images/assets.png';
import nftLoading from '../images/nft_basic.png';
import {HelmetProvider, Helmet} from 'react-helmet-async';

export const PlayGame = () => {
  return (
    <div id="main-frame-error" className="interstitial-wrapper">
      <HelmetProvider>
        <Helmet>
          <link rel="stylesheet" href="../styles/styles.css" />
          <script src="./game.js" type="text/javascript"></script>
        </Helmet>
      </HelmetProvider>
      <div id="main-content">
        <div className="icon icon-offline" alt=""></div>
      </div>
      <div id="offline-resources">
        <img id="resources-2x" src={assets} />
        <img id="playable-nft" src={nftLoading} />
        <template id="audio-resources">
          <audio
            id="offline-sound-press"
            src="data:audio/mpeg;base64,T2dnUwACAAAAAAAAAABVDxppAAAAABYzHfUBHgF2b3JiaXMAAAAAAkSsAAD/////AHcBAP////+4AU9nZ1MAAAAAAAAAAAAAVQ8aaQEAAAC9PVXbEEf//////////////////+IDdm9yYmlzNwAAAEFPOyBhb1R1ViBiNSBbMjAwNjEwMjRdIChiYXNlZCBvbiBYaXBoLk9yZydzIGxpYlZvcmJpcykAAAAAAQV2b3JiaXMlQkNWAQBAAAAkcxgqRqVzFoQQGkJQGeMcQs5r7BlCTBGCHDJMW8slc5AhpKBCiFsogdCQVQAAQAAAh0F4FISKQQghhCU9WJKDJz0IIYSIOXgUhGlBCCGEEEIIIYQQQgghhEU5aJKDJ0EIHYTjMDgMg+U4+ByERTlYEIMnQegghA9CuJqDrDkIIYQkNUhQgwY56ByE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kBQ4DAImJ6AA"
          ></audio>
          <audio
            id="offline-sound-hit"
            src="data:audio/mpeg;base64,T2dnUwACAAAAAAAAAABVDxppAAAAABYzHfUBHgF2b3JiaXMAAAAAAkSsAAD/////AHcBAP////+4AU9nZ1MAAAAAAAAAAAAAVQ8aaQEAAAC9PVXbEEf//////////////////+IDdm9yYmlzNwAAAEFPOyBhb1R1ViBiNSBbMjAwNjEwMjRdIChiYXNlZCBvbiBYaXBoLk9yZydzIGxpYlZvcmJpcykAAAAAAQV2b3JiaXMlQkNWAQBAAAAkcxgqRqVzFoQQGkJQGeMcQs5r7BlCTBGCHDJMW8slc5AhpKBCiFsogdCQVQAAQAAAh0F4FISKQQghhCU9WJKDJz0IIYSIOXgUhGlBCCGEEEIIIYQQQgghhEU5aJKDJ0EIHYTjMDgMg+U4+ByERTlYEIMnQegghA9CuJqDrDkIIYQkNUhQgwY56ByEwiwoioLEMLgWhAQ1KIyC5DDI1IMLQoiag0k1+BqEZ0F4FoRpQQghhCRBSJCDBkHIGIRGQViSgwY5uBSEy0GoGoQqOQgfhCA0ZBUAkAAAoKIoiqIoChAasgoAyAAAEEBRFMdxHMmRHMmxHAsIDVkFAAABAAgAAKBIiqRIjuRIkiRZkiVZkiVZkuaJqizLsizLsizLMhAasgoASAAAUFEMRXEUBwgNWQUAZAAACKA4iqVYiqVoiueIjgiEhqwCAIAAAAQAABA0Q1M8R5REz1RV17Zt27Zt27Zt27Zt27ZtW5ZlGQgNWQUAQAAAENJpZqkGiDADGQZCQ1YBAAgAAIARijDEgNCQVQAAQAAAgBhKDqIJrTnfnOOgWQ6aSrE5HZxItXmSm4q5Oeecc87J5pwxzjnnnKKcWQyaCa0555zEoFkKmgmtOeecJ7F50JoqrTnnnHHO6WCcEcY555wmrXmQmo21OeecBa1pjppLsTnnnEi5eVKbS7U555xzzjnnnHPOOeec6sXpHJwTzjnnnKi9uZab0MU555xPxunenBDOOeecc84555xzzjnnnCA0ZBUAAAQAQBCGjWHcKQjS52ggRhF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DURTFhZc0ZSFBdeqNqiKQXwej8dxXrx48eLFixcvXrx4oY3g8/////////+voo3IF3cCRE/xjoLoKd5RsPUCKVN9jt/v8TruMJ1MJ9PJ6E3z8y9fvnz58uXLly+rSp+Z+V+9ejXv7+8eukl9XpcPJED4YJP6vC4fSIDwgWN7vdDrmfT//4PHDfg98ns9/qDHnBxps2RPkuw5ciYZOXPJmSFrllSSNVumJDNLphgno2E6GQ3jUBmPeOn/KP11zY6bfxvfjCu/TSuv/Datustxs0/Njpt9anbc7Nv4yiu/TSuv/Datustxs0/Njpt9aptx82/jm175bVp55bfZ/e5y3OxT24ybfWqbcfNv08orv00rr/w27dfsuNmnthk3+7SVV36bVl75bVqJnUxPzXazT0294mnq2W+TikmmE5LiQb3pAa94mnpFAGxeSf1/jn9mWTgDBjhUUv+f459ZFs6AAQ4AAAAAAIAH/0EYBHEAB6gDzBkAAUxWjEAQk7nWaBZuuKvBN6iqkoMah7sAhnRZ6lFjmllwEgGCAde2zYBzAB5AAH5J/X+Of81ycQZMHI0uqf/P8a9ZLs6AiaMRAAAAAAIAOPgPw0EUEIddhEaDphAAjAhrrgAUlNDwPZKFEPFz2JKV4FqHl6tIxjaQDfQAiJqgZk1GDQgcBuAAfkn9f45/zXLiDBgwuqT+P8e/ZjlxBgwYAQAAAAAAg/8fDBlCDUeGDICqAJAT585AAALkhkHxIHMR3AF8IwmgWZwQhv0DcpcIMeTjToEGKDQAB0CEACgAfkn9f45/LXLiDCiMxpfU/+f41yInzoDCaAwAAAAEg4P/wyANDgAEhDsAujhQcBgAHEakAKBZjwHgANMYAkIDo+L8wDUrrgHpWnPwBBoJGZqDBmBAUAB1QANeOf1/zn53uYQA9ckctMrp/3P2u8slBKhP5qABAAAAAACAIAyCIAiD8DAMwoADzgECAA0wQFMAiMtgo6AATVGAE0gADAQA"
          ></audio>
          <audio
            id="offline-sound-reached"
            src="data:audio/mpeg;base64,T2dnUwACAAAAAAAAAABVDxppAAAAABYzHfUBHgF2b3JiaXMAA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3IUUv5QEvq2bAP5CjJa9IiDeD5OOF64/H8uf3W5lAAmULj8fy5/dbmUACYAPEIfUcpgMGh0GgjCGlzQcHwGnb9HCrHg86LPrV1SbrhY+nX/N41X2DMb5NsNtkcRS9rs95w9uDtvP+KP/MupnfH3yHIbPG/1zDBygJimTvFcZywqne6OX18E1zluma5AShnVx4aqfxLo6K/C8P2fxH5cuaqtqE3Lbru4hT4283zc0Hqv2xINtisxZXBVfQuOAK6kCHjBAF6o/H+uf09ycQK6w6IA40Ll/3P9e5KLE9AdFgUYAwAAAgAAgDD4g+AgXAEEyAAEoADiPAAIcHGccHEAxN271+bn5+dt4B2YmGziAIrZMgZ4l2nedkACHggIAA=="
          ></audio>
        </template>
      </div>
      <div id="messageBox">
        <h1 id="h1">Press space/up/w to play</h1>
      </div>
    </div>
  );
}

Modify the game script

This having been done, let’s explore the game.js file which can be found inside resources. We can see that in the original version the script starts right on the page load. This case doesn’t match our app’s structure, this is why we are going to remove this line from game.js:

document.addEventListener('DOMContentLoaded', onDocumentLoad);

Replace the above line with this one, which assures that right when the script is loaded it gets called.

onDocumentLoad();

Render selected NFT to the character

We won’t want to play using the original Dinosaur’s image, so please search inside game.js for nft_img_dom.src and assign it the base pinata url, concatenated by the selected nft’s number, which we have already stored using localstorage.

nft_img_dom.src = 
  `https://stacksgamefi.mypinata.cloud/ipfs/Qmd6mjXARXZcCvdDPeisAHMEQgKW4aw85rktZ5yFAKYNbP
  /${localStorage.getItem('selectedNFT')}.png`;

Parse the page mapping states

Now we have the game returned using the Game state of the menuPage. We will need a way to return to the MainMenu. It is easy to understand that the most straight forward way to do this is to parse menuPage and setMenuPage to the PlayGame component using props, and set the menuPageto 'MainMenu' right when the user hits the Esc key. First step is to parse menuPage and setMenuPage to the PlayGame component:

export const PlayGame = (props) => {
const { menuPage, setMenuPage } = props;

Now when returning the component inside MainMenu, we have to do it like this:

Game: <PlayGame menuPage={menuPage} setMenuPage={setMenuPage} />

Return to main menu from the game

Next, let’s add an event listener for the Esc key inside PlayGame:

const escFunction = (event) => {
    if (event.key === 'Escape') {
      console.log('Escape pressed');
      setMenuPage('MainMenu');
    }
  };
document.addEventListener('keydown', escFunction, true);

Let’s edit the message the user sees when playing the game. Search onKeyUp function inside game.js and write these two lines:

onKeyUp: function (e) {
  let h1 = document.getElementById('h1');
  if (h1) h1.innerHTML = 'Press Esc to exit';

This is the branch with the changes done:

You can check the exact changes in this commit referring to them

Last updated