HTML and CSS Reference
In-Depth Information
this.paused = true;
},
unpause: function() {
this.paused = false;
},
_hitTest: function(obj,type) {
if(obj != this) {
var col = (!type || this.p.type & type) && Q.overlap(obj,this);
return col ? this : false;
}
},
collide: function(obj,type) {
return this.detect(this._hitTest,obj,type);
},
step:function(dt) {
if(this.paused) { return false; }
this.trigger("prestep",dt);
this.eachInvoke("step",dt);
this.trigger("step",dt);
if(this.removeList.length > 0) {
for(var i=0,len=this.removeList.length;i<len;i++) {
this.forceRemove(this.removeList[i]);
}
this.removeList.length = 0;
}
},
draw: function(ctx) {
if(this.options.sort) {
this.items.sort(this.options.sort);
}
this.trigger("predraw",ctx);
this.eachInvoke("draw",ctx);
this.trigger("draw",ctx);
}
});
The Q.Stage object inherits from the Q.GameObject , as you might expect, allowing it to bind and trig-
ger events as well as add additional behaviors via components. The init method sets up the initial properties
on the object and executes the scene method if a scene object were passed in. The Quintus stage object also
supports the idea of z order, allowing objects to be sorted prior to rendering.
Search WWH ::




Custom Search