human

0.1.5 • Public • Published

Human.js Library

Install

caolan's async.js is required.

In Browser

<script type="text/javascript" src="https://raw.github.com/caolan/async/master/lib/async.js"></script>
<script type="text/javascript" src="https://raw.github.com/jackcannon/human.js/master/js/human.js"></script>

In Node.js

Install using:

npm install human

Include using:

var Human = require('human');

Usage

Constructor

The constructor takes 1 optional object parameter called options. The properties for this object are all optional, and are as follows:

  • gender - String. The gender of the Human (e.g. 'male', 'female'). Default: 'male'
  • name - String. The name of the Human (e.g. 'Jack', 'Henry'). Default: random popular name based on gender
  • orientation - String. Left or Right handed (e.g. 'left', 'right'). Default: 'right'
  • x - Number. The x coordinate position of the Human (e.g. 0). Default: 0
  • y - Number. The y coordinate position of the Human (e.g. 0). Default: 0

Example

var Jack = new Human({
	name: 'Jack',
	gender: 'male',
	orientation: 'left',
	x: 0,
	y: 0
});

Functions

  • say - Make the Human say something (sets to .saying property)
  • face - Change the way the Human is facing
  • wave - The Human gives a friendly wave
  • dance/robot - Performs a lovely little dance

What else?

Not everything is going to be in this documentation. The library is meant to be explored and experimented with. An example of the Object in use can be found in index.html or at humanjs.com

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.513latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.513
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i human

Weekly Downloads

13

Version

0.1.5

License

none

Last publish

Collaborators

  • jackcannon