Skip to content
nhmkdev edited this page Jan 17, 2014 · 38 revisions

This is a work in progress! Documentation is not complete and is definitely under construction!

The Support Framework is a collection of basic components intended to accelerate the development of ImpactJS+Intel XDK(optional) based applications (or to inspire other solutions!).

Prerequisites:

  • ImpactJS (http://impactjs.com/) is required (and some working knowledge of ImpactJS). This repo is equivalent to the root of a folder containing the index.html to initialize the application.

Optional:

Important Notes:

  • I am not a JavaScript master
  • I am learning more about JavaScript by working within the ImpactJS and Intel XDK environments/frameworks.

Upcoming Goals:

  • Migrate existing code into the Support Framework repo
  • Add a basic demo of the various components in action
  • Lots of documentation
  • Lots of code improvements
  • Further support for Intel XDK specifics (input etc.)

Common Code Themes

Minimizing code size

In many of the code files it is common to find the reassignment of the long nested properties of a data or otherwise object to a local variable.

var Windows = ig.global.data.windows;

While the savings is minimal in most cases it also makes the code easier to read (the capitalization in particular makes these collections stand out).

Another reduction is in the form of data reuse. Certain components are intended to be referenced by others (ie. windows referenced by dialogs or custom menus). Any sort of object reuse you can use will cut down on your development time when making minor modifications. There are also a few instances of a "base" setting concept where the original definition can be reused and overridden as necessary.

Include Files

Some of the files in the framework are just collections of other files. This is intended to avoid having to update numerous files just to add a new item type. There is also a minor code size optimization in doing so. One area to be wary of is circular references in the data. The various types currently do not overlap but if you make any modifications take care in checking what needs to reference what!

Container

In the documentation the word Container is an indicator of a specific reference to a given item. These are always exclusively nested under the ig.global object.

Code Comments

While most functions have a comment describing all inputs and return values, those that are ImpactJS related generally do not as those are covered in the documentation.

Data Files / Objects

ig.global.data is the main container for all data objects intended for use with the Support Framework. These objects help centralize various types into a single location for convenience. Types can easily be split across code files by assigning to the same given object. Example: ig.global.data.interacts might be assigned child properties in both leveldoors.js and switches.js: ig.global.data.interacts.leveldoors.door01 = {} and ig.global.data.interacts.switches.main = {}

NOTE In a few instances you may see javascript data that looks incorrectly formatted. This is likely due to copy and pasted code being mangled by markdown when trying to interpret two [ characters.

Data Driven

There are a lot of data driven components in the Support Framework. Even logic is driven and written in data in some instances. Some basic types of entities can be created without writing new code cutting down on both code size and (arguably) complexity.

Status Definition

In the sections below you will see a status of both code and documentation on a given subject written in the following format: (Code - Good) (Documentation - Rough)

Basically Good should be an indicator that things are in decent shape and usable. Rough indicates an area under construction. Anything unmarked can be assumed to be in Rough status. Many items do not have extensive documentation on the wiki due to the comments in the code files.

Folder Layout

  • \media (standard ImpactJS media folder)
  • \lib\data (contains all the data structures used by the support framework)
  • \lib\game\entities (standard ImpactJS entities folder)
  • \lib\game\entities\spawned (entities that are spawned by game code)
  • \lib\game\levels (standard ImpactJS levels folder)
  • \lib\game\objects (Support Framework objects folder for special game specific handling)
  • \lib\impact *
  • \lib\support (contains all the Support Framework core classes)
  • \lib\weltmeister *

(*) items from ImpactJS

Support Topics

Support Entities

See the source for each item for details on their usage (how to setup in Weltmeister). (TODO: link to source)

Below are items that need a bit more information on their definition

Support Components

Support Game Objects

Demo Construction

Clone this wiki locally