src/PlayerCharacter.js
/**
 * Object holding the playable character
 *
 * @constructor
 * @auguments HittableGameObject
 */
Object holding the playable character
@constructor
@auguments HittableGameObject
Object holding the playable character @constructor @auguments HittableGameObject
function PlayerCharacter() {
    HittableGameObject.apply(this, [false, false]);
	this.startPos = new Vec2(0, 0);
	this.power = 0;
	this.facingRight = true;
	this.ladder = {};
	this.ladder.set = function(rect) {
	    this.isNear = true;
	    this.position = rect.center().x;
	    this.bottom = rect.y1;
	};
	this.ladder.reset = function() {
	    this.isNear = false;
	    this.position = 0.0;
	    this.bottom = 0.0;
	};
	this.ladder.reset();
	var statesList = [
		PCStates.kStateIdle,   IdleState,
		PCStates.kStateWalk,   WalkState,
		PCStates.kStateJump,   JumpState,
		PCStates.kStateFall,   FallState,
		PCStates.kStateClimb,  ClimbState,
		PCStates.kStateSprint, SprintState,
		PCStates.kStateHide,   HideState,
		PCStates.kStateUnhide, UnhideState,
		PCStates.kStateSwing,  SwingState,
		PCStates.kStateDamaged,    DamagedState,
		PCStates.kStateKnockedOut, KnockedOutState,
		PCStates.kStateJumpAttack, JumpAttackState,
		PCStates.kStateDialogueEvent, DialogueEventState,
		PCStates.kStateBarrelRollStart, BarrelRollStartState,
		PCStates.kStateBarrelRoll, BarrelRollState,
		PCStates.kStateBarrelRollEnd, BarrelRollEndState,
		PCStates.kStateStartShuffle, StartShuffleState,
		PCStates.kStateShuffle, ShuffleState,
		PCStates.kStateEndShuffle, EndShuffleState,
		PCStates.kStateTurnShuffle, TurnShuffleState
	];
	this.hittableRect = new Rectf(-20, -60, 20, 0);
	this.fsm = new FSM(this, statesList);
	this.movement = new MovementComponent();
	this.stepIn = 0;
	this.animation = null;
	this.Effect = function (type, pos, anim) {
		this.type = type;
		this.pos = pos;
		this.anim = anim;
	};
	this.EffectType = {
		kWorldSpace : 0,
		kLocal      : 1
	};
	this.effectAnims = [];
	this.triggerObject = null;
	HittableGameObject.apply(this, arguments);
	this.setCameraOffset(new Vec2(0, -128));
	this.maxHits = 6;
	this.lastLamppost = null;
}
function PlayerCharacter ( ) { HittableGameObject . apply ( this , [ false , false ] ) ; this . startPos = new Vec2 ( 0 , 0 ) ; this . power = 0 ; this . facingRight = true ; this . ladder = { } ; this . ladder . set = function ( rect ) { this . isNear = true ; this . position = rect . center ( ) . x ; this . bottom = rect . y1 ; } ; this . ladder . reset = function ( ) { this . isNear = false ; this . position = 0.0 ; this . bottom = 0.0 ; } ; this . ladder . reset ( ) ; var statesList = [ PCStates . kStateIdle , IdleState , PCStates . kStateWalk , WalkState , PCStates . kStateJump , JumpState , PCStates . kStateFall , FallState , PCStates . kStateClimb , ClimbState , PCStates . kStateSprint , SprintState , PCStates . kStateHide , HideState , PCStates . kStateUnhide , UnhideState , PCStates . kStateSwing , SwingState , PCStates . kStateDamaged , DamagedState , PCStates . kStateKnockedOut , KnockedOutState , PCStates . kStateJumpAttack , JumpAttackState , PCStates . kStateDialogueEvent , DialogueEventState , PCStates . kStateBarrelRollStart , BarrelRollStartState , PCStates . kStateBarrelRoll , BarrelRollState , PCStates . kStateBarrelRollEnd , BarrelRollEndState , PCStates . kStateStartShuffle , StartShuffleState , PCStates . kStateShuffle , ShuffleState , PCStates . kStateEndShuffle , EndShuffleState , PCStates . kStateTurnShuffle , TurnShuffleState ] ; this . hittableRect = new Rectf ( - 20 , - 60 , 20 , 0 ) ; this . fsm = new FSM ( this , statesList ) ; this . movement = new MovementComponent ( ) ; this . stepIn = 0 ; this . animation = null ; this . Effect = function ( type , pos , anim ) { this . type = type ; this . pos = pos ; this . anim = anim ; } ; this . EffectType = { kWorldSpace : 0 , kLocal : 1 } ; this . effectAnims = [ ] ; this . triggerObject = null ; HittableGameObject . apply ( this , arguments ) ; this . setCameraOffset ( new Vec2 ( 0 , - 128 ) ) ; this . maxHits = 6 ; this . lastLamppost = null ; }
Object holding the playable character
 @constructor
 @auguments HittableGameObject
Object holding the playable character @constructor @auguments HittableGameObject
// ladder info /**
	 * Effect animation object
	 *
	 * @param {EffectType} type
	 * @param {Vec2}       pos   Position of animation
	 * @param {AnimationHandle} anim
	 */ // TODO Temporary setting of PC:s max hitpoints