timerTick: function(){
HorizonalScrollStageClass.base.prototype.timerTick.call(this);
- if(this.userControlledCharacter) this.scrollTo(this.getScrollLocation());
- this.eachStageObject(function(f){
- f.movingSpeedY -= 1;
- return true;
- });
+ if(this.userControlledCharacter){
+ //\83L\83\83\83\89\83N\83^\81[\82ð\92Ç\94ö\82·\82é
+ this.scrollTo(this.getScrollLocation());
+ }
+ //this.eachStageObject(function(f){
+ // f.movingSpeedY -= 1;
+ // return true;
+ //});
},
// \8eq\83X\83e\81[\83W\82Å\81A\91\80\8dì\92\86\83L\83\83\83\89\88È\8aO\82ð\92\86\90S\82É\8e\9d\82Á\82Ä\82«\82½\82¢\82Æ\82«\82Í\82±\82Ì\8aÖ\90\94\82ð\83I\81[\83o\81[\83\89\83C\83h\82·\82é
- getScrollLocation: function()
- {
+ getScrollLocation: function(){
var pos = 0;
- if(this.userControlledCharacter)
- {
+ if(this.userControlledCharacter){
return this.userControlledCharacter.origin.x - 320;
}
return 0;
},
- draw: function()
- {
+ draw: function(){
this.drawBackground();
-
this.drawAsPoint(this.scrollX, 0);
},
drawBackground: function(){
- if(this.background)
- {
+ if(this.background){
//\89æ\96Ê\88Ê\92u\82É\8d\87\82í\82¹\82Ä\89æ\91\9c\82ð\83X\83N\83\8d\81[\83\8b\95\\8e¦\82·\82é
var width = this.background.width;
var pos = -((this.scrollX / 2) % width);
//\83L\83\83\83\93\83o\83X\82ð\91S\8fÁ\8b\8e
this.mainContext.clearRect(0, 0, this.mainCanvas.width, this.mainCanvas.height);
}
- if(this.collisionMapContext)
- {
+ if(this.collisionMapContext){
this.collisionMapContext.clearRect(0, 0, this.collisionMapCanvas.width, this.collisionMapCanvas.height);
}
},
//\83X\83N\83\8d\81[\83\8b\82µ\82½\82¢\82Æ\82«\82É\81Atick\96\88\82É\8cÄ\82Ô\81B
scrollTo: function(x){
this.scrollX += (x - this.scrollX) / 7;
- if(this.scrollX > this.scrollMaxX) this.scrollX = this.scrollMaxX;
- if(this.scrollX < 0) this.scrollX = 0;
+ if(this.scrollX > this.scrollMaxX){
+ this.scrollX = this.scrollMaxX;
+ }
+ if(this.scrollX < 0){
+ this.scrollX = 0;
+ }
}
});