Next, let's write the code for the Game view. We won't cover all the code—there's a good amount of it that should be familiar, and there are some portions that we'll break out into additional sections. When we're done with the project, we'll have a view that looks like the following screenshot:
First, let's get the template out of the way (in www/html/gameView.html
):
<html> <body> <div class="ui-container"> <div class="game-content-area"> <div class="game-overlay"> <div class="game-left">L</div> <div class="game-right">R</div> <div class="game-message">%TAPTOSTART%</div> <div class="action-group"> <div class="game-action button">%START%</div> <div class="game-back button">%BACK%</div> </div> </div> <canvas class="game-canvas"></canvas> </div> </div> </body> </html>