2 var HorizonalScrollStageClass = function()
4 HorizonalScrollStageClass.base.apply(this, []);
7 this.scrollMaxX =1280 - 640; //
\83X
\83e
\81[
\83W
\82Ì
\89¡
\82Ì
\92·
\82³-640
10 className: "HorizonalScrollStageClass",
11 timerTick: function(){
13 HorizonalScrollStageClass.base.prototype.timerTick.call(this);
14 if(this.userControlledCharacter){
15 //
\83L
\83\83\83\89\83N
\83^
\81[
\82ð
\92Ç
\94ö
\82·
\82é
16 this.scrollTo(this.getScrollLocation());
18 //this.eachStageObject(function(f){
19 // f.movingSpeedY -= 1;
24 //
\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é
25 getScrollLocation: function(){
27 if(this.userControlledCharacter){
28 return this.userControlledCharacter.origin.x - 320;
34 this.drawBackground();
35 this.drawAsPoint(this.scrollX, 0);
37 drawBackground: function(){
39 //
\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é
40 var width = this.background.width;
41 var pos = -((this.scrollX / 2) % width);
42 for(;pos < this.background.width; pos += width)
44 this.mainContext.drawImage(this.background, pos, 0, this.background.width, this.background.height);
47 //
\83L
\83\83\83\93\83o
\83X
\82ð
\91S
\8fÁ
\8b\8e
48 this.mainContext.clearRect(0, 0, this.mainCanvas.width, this.mainCanvas.height);
50 if(this.collisionMapContext){
51 this.collisionMapContext.clearRect(0, 0, this.collisionMapCanvas.width, this.collisionMapCanvas.height);
55 //
\83X
\83N
\83\8d\81[
\83\8b\82µ
\82½
\82¢
\82Æ
\82«
\82É
\81Atick
\96\88\82É
\8cÄ
\82Ô
\81B
56 scrollTo: function(x){
57 this.scrollX += (x - this.scrollX) / 7;
58 if(this.scrollX > this.scrollMaxX){
59 this.scrollX = this.scrollMaxX;