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) this.scrollTo(this.getScrollLocation());
15 this.eachStageObject(function(f){
21 //
\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é
22 getScrollLocation: function()
25 if(this.userControlledCharacter)
27 //pos = this.userControlledCharacter.direction == 0 ? -100 : (this.userControlledCharacter.direction == 1 ? 100 : 0);
28 return this.userControlledCharacter.origin.x - 320;
35 this.drawBackground();
37 this.drawAsPoint(this.scrollX, 0);
39 drawBackground: function(){
42 //
\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é
43 var width = this.background.width;
44 var pos = -((this.scrollX / 2) % width);
45 for(;pos < 640; pos += width)
47 this.mainContext.drawImage(this.background, pos, 0, 640, 480);
51 //
\83L
\83\83\83\93\83o
\83X
\82ð
\91S
\8fÁ
\8b\8e
52 this.mainContext.clearRect(0, 0, this.mainCanvas.width, this.mainCanvas.height);
54 if(this.collisionMapContext)
56 this.collisionMapContext.clearRect(0, 0, this.collisionMapCanvas.width, this.collisionMapCanvas.height);
60 //
\83X
\83N
\83\8d\81[
\83\8b\82µ
\82½
\82¢
\82Æ
\82«
\82É
\81Atick
\96\88\82É
\8cÄ
\82Ô
\81B
61 scrollTo: function(x){
62 this.scrollX += (x - this.scrollX) / 7;
63 if(this.scrollX > this.scrollMaxX) this.scrollX = this.scrollMaxX;
64 if(this.scrollX < 0) this.scrollX = 0;