Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.33 KB

instructions.md

File metadata and controls

31 lines (24 loc) · 1.33 KB

Setting up build system

Create a new build system (name is not important), replace the generated contents with the contents of tower-defense.sublime-build, replace PATH_TO_USER_FOLDER with the path to your user folder (e.g. C:\Users\username), save, go to tools->build system-> select your build system. ctrl+b to build.

Adding a new file

  1. Add it to the end of the script list in index.html
  2. add it to the end of the include array in app.build.js

Add a function to the rendering loop:

Append it to the end of the animate() function.

Initialization before draw loop begins:

e.g. (loading sprites, etc): Place before the animate function is called in the event listener in init.js

Global variables are located in var.js

Require.js is being used for the build system. Prerequisites: npm install requirejs

Tips and tricks

To keep things small, string interpretations e.g. (someVariable === "someString") which minifies like (a === "someString"), should defined as a global constant (const CONSTANT_NAME) e.g. (someVariable === SOME_STRING) which minifies like: (a === b)