Game Development Reference
In-Depth Information
Preparing for the Project
Several files and classes need to be set up for the creation of this game project. This section will walk you through the
necessary steps to prepare for the game, starting with the single HTML file, index.html .
Setting Up the HTML
The HTML file used for this game will include several JavaScript files. It will also create an instance of the application
and fire its init function, which will initialize the application. Saved data will be retrieved and loaded into the game
from local storage, and a handful of global variables are declared for use throughout the application. Listing 14-1
shows the entire index.html file.
Listing 14-1. The index.html File for The Village RPG
<!DOCTYPE html>
<html>
<head>
<title>Meynard RPG</title>
<link href="css/styles.css" rel="stylesheet" type="text/css"/>
<!--CREATEJS-->
<script src="js/lib/easeljs-0.7.1.min.js"></script>
<script src="js/lib/soundjs-0.5.2.min.js"></script>
<script src="js/lib/preloadjs-0.4.1.min.js"></script>
<script src="js/lib/tweenjs-0.5.1.min.js"></script>
<script src="js/lib/BitmapText.js"></script>
<!--DATA-->
<script src="js/data/data.js"></script>
<!--GAME CLASSES-->
<script src="js/state.js"></script>
<script src="js/events.js"></script>
<script src="js/classes/Hero.js"></script>
<!--COMPONENTS-->
<script src="js/classes/components/Preloader.js"></script>
<!--SCENES-->
<script src="js/scenes/GameMenu.js"></script>
<script src="js/scenes/LevelSelect.js"></script>
<script src="js/scenes/Game.js"></script>
<script src="js/scenes/LevelComplete.js"></script>
<!--MANAGERS-->
<script src="js/classes/managers/AssetManager.js"></script>
<!--SPRITES-->
<script src="js/classes/sprites/BattlePanel.js"></script>
<script src="js/classes/sprites/BattleButton.js"></script>
 
Search WWH ::




Custom Search