Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Cleod9/elevatorjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ElevatorJS


This is a sample application that was built with AS3JS. It's an engine for an elevator simulator built with ActionScript 3.0 source code that executes in HTML5 without the Flash Player. For kicks I've included a Flash SWF just to demonstrate how easy it is to port. If you want to compile the Flash version yourself via the Flash IDE, you can grep the .as files for the text "For AS3" to find the code lines you'll need to modify.

See Live Demo Here

Initialization

The bulk of the setup for initializing the engine goes like this:

var engine = new ElevatorEngine({
	entranceFloor: /* Reference to the entrance floor object */,
	elevators: [ /* Array of Elevator objects */ ],
	floors: [ /* Array of Floor objects */ ],
	people: [ /* Array of People objects */ ]
});

//Start the engine
engine.start();

You can explore the source code to see how to initialize the individual Floors, People, and Elevators. But please note this project is mainly designed for demonstration purposes, so there is limited configuration.

To Perform a Build

With Node.js installed on your system, run npm install from within the project folder to install its dependencies. Then elevator.js can be recompiled via the following this command:

node build

Open elevator.htm to view.


Copyrighted © 2015 by Greg McLeod

GitHub: https://github.com/cleod9