// isNestedOnTop.js
(function () {
/*global adventurejs A*/
var p = adventurejs.Character.prototype;
/**
* Determine if player is nested at the bottom of parent asset.
* @memberOf adventurejs.Character
* @method adventurejs.Character#isNestedOnTop
* @return {Boolean}
*/
p.isNestedOnTop = function Character_isNestedOnTop() {
var bool = false;
if (false === this.isNested("on")) {
return false;
}
var thing = this.getNestAsset();
if (false === thing) return false;
var top = thing.getYTop();
if (this.position.y >= top) {
bool = true;
}
return bool;
};
})();