OSDN Git Service

GameStageおよびStageObjectはclassesの中に移動しました
authorttwilb <ttwilb@users.sourceforge.jp>
Mon, 29 Jul 2013 02:25:13 +0000 (11:25 +0900)
committerttwilb <ttwilb@users.sourceforge.jp>
Mon, 29 Jul 2013 02:25:13 +0000 (11:25 +0900)
www/FILES.txt [new file with mode: 0644]
www/corelib/classes/GameStageClass.js [new file with mode: 0644]
www/corelib/classes/StageObjectClass.js [new file with mode: 0644]
www/corelib/core.js
www/corelib/header.js [new file with mode: 0644]
www/corelib/jsbase.js [new file with mode: 0644]
www/index.html
www/lab/index.html [new file with mode: 0644]

diff --git a/www/FILES.txt b/www/FILES.txt
new file mode 100644 (file)
index 0000000..bafb75f
--- /dev/null
@@ -0,0 +1,6 @@
+corelib/core.js                \83Q\81[\83\80\83V\83X\83e\83\80\82Ì\83v\83\8d\83O\83\89\83\80\82Ì\92\86\90S(by hikarupsp)
+corelib/jsbase.js      JavaScript\82Å\83I\83u\83W\83F\83N\83g\8ew\8cü\82ð\8eÀ\8c»\82·\82é(by ttwilb)
+corelib/header.js      html\82©\82ç\93Ç\82Ý\8d\9e\82Þjs\83t\83@\83C\83\8b(\82±\82ê\82¾\82¯\93Ç\82Ý\8d\9e\82ß\82Î\82 \82Æ\82ÍOK\81I\81I)
+lab/*                  \8eÀ\8c±\97p\82Ì\83t\83@\83C\83\8b
+corelib/classes/*.js   \88ê\82Â\88ê\82Â\82Ì\83N\83\89\83X\82É\91Î\89\9e\82·\82é\83t\83@\83C\83\8b
+stage/                 \83X\83e\81[\83W\83t\83@\83C\83\8b
diff --git a/www/corelib/classes/GameStageClass.js b/www/corelib/classes/GameStageClass.js
new file mode 100644 (file)
index 0000000..99167d9
--- /dev/null
@@ -0,0 +1,82 @@
+
+//
+//\83Q\81[\83\80\83X\83e\81[\83W
+//
+
+function GameStage(){
+       //****\83R\83\93\83X\83g\83\89\83N\83^****
+       //**\83C\83\93\83X\83^\83\93\83X\95Ï\90\94\90é\8c¾\81E\8f\89\8aú\89»**
+       //\83^\83C\83}\81[\83J\83E\83\93\83g\82ð\8f\89\8aú\89»
+       this.tickCount = 0;
+       //GameManager\82©\82ç\93n\82³\82ê\82é\83v\83\8d\83p\83e\83B
+       this.manager = null;
+       this.mainCanvas = null;
+       this.debugCanvas = null;
+       this.mainContext = null;
+       this.debugContext = null;
+       //StageObject\82Ì\83\8a\83X\83g
+       this.stageObjectList = new Array();
+       //\83I\81[\83o\81[\83\89\83C\83h\82³\82ê\82é\89Â\94\\90«\82Ì\82 \82é\8aÖ\90\94\82Ì\95Û\91
+       //this.super = new Object();
+       //\8fã\8bL\82Ì\95û\96@\82Å\82Í\81Athis\82ªsuper\82É\82È\82Á\82Ä\82µ\82Ü\82¢\93®\8dì\82µ\82È\82¢\82Ì\82Å\81A\93¯\88ê\8aK\91w\82É\8aÖ\90\94\82Ì\8eQ\8fÆ\82ð\8dì\90¬\82·\82é\82±\82Æ\82É\82È\82Á\82½\81B
+       this.super_keyDown = this.keyDown;
+       this.super_keyUp = this.keyUp;
+       this.super_timerTick = this.timerTick;
+       this.super_runStage = this.runStage;
+       this.super_stopStage = this.stopStage;
+       this.super_addStageObject = this.addStageObject;
+       this.super_removeStageObject = this.removeStageObject;
+       //\8fÕ\93Ë\94»\92è\97pcanvas
+       this.collisionMapCanvas = null;
+       this.collisionMapContext = null;
+}
+GameStage.prototype = {
+       //\88È\89º\82Ì\8aÖ\90\94\82ð\83I\81[\83o\81[\83\89\83C\83h\82µ\82Ä\83X\83e\81[\83W\82ð\8dì\90¬\82·\82é\81B
+       keyDown: function(event){
+               //\83L\81[\93ü\97Í
+       },
+       keyUp: function(event){
+               //\83L\81[\93ü\97Í
+       },
+       timerTick: function(){
+               //\83^\83C\83}\81[
+               
+               this.tickCount++;
+               drawText(this.debugContext, "tick:" + this.tickCount, 0, 20);
+               
+               //\83L\83\83\83\93\83o\83X\82ð\91S\8fÁ\8b\8e
+               this.mainContext.clearRect(0, 0, this.mainCanvas.width, this.mainCanvas.height);
+               this.collisionMapContext.clearRect(0, 0, this.collisionMapCanvas.width * 8, this.collisionMapCanvas.height * 8);
+               //\91S\82Ä\82Ì\83I\83u\83W\83F\83N\83g\82ð\8dÄ\95`\89æ
+               
+               for(i = 0; i < this.stageObjectList.length; i++){
+                       this.stageObjectList[i].display();
+               }
+       },
+       runStage: function(){
+               //\83X\83e\81[\83W\8f\89\8aú\89»\8f\88\97\9d
+               this.tickCount = 0;
+               //\8fÕ\93Ë\83}\83b\83v\8f\89\8aú\89»
+               this.collisionMapCanvas = createCanvas("collisionMapCanvas", this.mainCanvas.width, this.mainCanvas.height, this.mainCanvas.width, 0, 1, "MainArea");
+               this.collisionMapContext = this.collisionMapCanvas.getContext('2d');
+               this.collisionMapContext.fillStyle = "rgba(0,0,0, 0.2)";
+               this.collisionMapContext.strokeStyle = "rgba(0,0,0, 0.2)";
+               this.collisionMapContext.scale(1, 1);
+       },
+       stopStage: function(){
+               //\83X\83e\81[\83W\8fI\97¹\8f\88\97\9d
+               destroyDOMObjectByID(this.collisionMapCanvas.id);
+               this.collisionMapCanvas = null;
+               this.collisionMapContext = null;
+               this.stageObjectList = null;
+       },
+       addStageObject: function(aStageObject){
+               //StageObject\92Ç\89Á\8f\88\97\9d
+               this.stageObjectList.push(aStageObject);
+       },
+       removeStageObject: function(aStageObject){
+               //StageObject\8dí\8f\9c\8f\88\97\9d
+               removeObjectFromArray(this.stageObjectList, aStageObject);
+       }
+}
+
diff --git a/www/corelib/classes/StageObjectClass.js b/www/corelib/classes/StageObjectClass.js
new file mode 100644 (file)
index 0000000..10a5d47
--- /dev/null
@@ -0,0 +1,77 @@
+//
+//\83L\83\83\83\89\83N\83^\81[
+//
+
+function StageObject(aStage){
+       this.stage = aStage;
+       this.origin = new Point2D(10, 10);
+       //origin\82ð\92\86\90S\82Æ\82µ\82½\8dÀ\95W\82Å\82Ì\83I\83u\83W\83F\83N\83g\82Ì\95`\89æ\96Ê\82Ì\83T\83C\83Y
+       this.frame = new Rectangle(-8, -8, 16, 16);
+       this.movingSpeed = new Point2D(0, 0);
+       //2 * hysteresis >= movingFriction\82Å\82 \82é\82±\82Æ\82ð\90\84\8f§\82·\82é\81B
+       //\82»\82¤\82Å\82È\82¢\8fê\8d\87\81A\96\80\8eC\82Å\82Ì\8c¸\91¬\8cã\82É\8a®\91S\82É\92â\8e~\82Å\82«\82È\82¢\89Â\94\\90«\82ª\82 \82é\81B
+       this.movingFriction = 90;
+       this.hysteresis = this.movingFriction / 2;
+       //\8eÀ\91Ì\82ð\8e\9d\82½\82È\82¢\81A\82Â\82Ü\82è\8fÕ\93Ë\94»\92è\82ª\95K\97v\82È\82¢\8fê\8d\87\82Ítrue.
+       this.isPhantom = false;
+       //console.log("StageObject:Init");
+}
+StageObject.prototype = {
+       display: function(){
+               //\8dÄ\95`\89æ\8e\9e\82É\8cÄ\82Î\82ê\82é\81B
+               this.computeTickMoving();
+               this.computeTickFriction();
+               this.computeTickBounding();
+               //\8cÊ\82Ì\95`\89æ
+               this.stage.mainContext.save();
+               this.stage.mainContext.fillStyle = "rgba(" + (((11*this.frame.size.x) & 0x7f) + 0x80) + "," + (((19*this.frame.size.x) & 0x7f) + 0x80) + "," + (((17*this.frame.size.x) & 0x7f) + 0x80) + ",0.5)";
+               drawArcDegree(this.stage.mainContext, this.frame.size.x / 2, 0, 360, this.origin.x, this.origin.y, false);
+               this.stage.mainContext.restore();
+               //\8fÕ\93Ë\83}\83b\83v\82É\95`\89æ
+               strokeRect(this.stage.collisionMapContext, this.origin.x + this.frame.origin.x, this.origin.y + this.frame.origin.y, this.frame.size.x, this.frame.size.y);
+       },
+       computeTickFriction: function(){
+               //\96\80\8eC\8f\88\97\9d
+               if(this.movingSpeed.x < -this.hysteresis){
+                       this.movingSpeed.x += this.movingFriction / this.stage.manager.tickPerSecond;
+               } else if(this.movingSpeed.x > this.hysteresis){
+                       this.movingSpeed.x -= this.movingFriction / this.stage.manager.tickPerSecond;
+               } else{
+                       this.movingSpeed.x = 0;
+               }
+               if(this.movingSpeed.y < -this.hysteresis){
+                       this.movingSpeed.y += this.movingFriction / this.stage.manager.tickPerSecond;
+               } else if(this.movingSpeed.y > this.hysteresis){
+                       this.movingSpeed.y -= this.movingFriction / this.stage.manager.tickPerSecond;
+               } else{
+                       this.movingSpeed.y = 0;
+               }
+       },
+       computeTickMoving: function(){
+               //\89^\93®\8f\88\97\9d
+               this.origin.x += this.movingSpeed.x / this.stage.manager.tickPerSecond;
+               this.origin.y += this.movingSpeed.y / this.stage.manager.tickPerSecond;
+       },
+       computeTickBounding: function(){
+               //\95Ç\96Ê\92µ\82Ë\95Ô\82è\8f\88\97\9d
+               if(this.origin.x < -this.frame.origin.x){
+                       //\8d\95Ç\96Ê
+                       this.origin.x = -this.frame.origin.x;
+                       this.movingSpeed.x = -this.movingSpeed.x;
+               } else if(this.origin.x > this.stage.mainCanvas.width - (this.frame.origin.x + this.frame.size.x)){
+                       //\89E\95Ç\96Ê
+                       this.origin.x = this.stage.mainCanvas.width - (this.frame.origin.x + this.frame.size.x);
+                       this.movingSpeed.x = -this.movingSpeed.x;
+               }
+               if(this.origin.y < -this.frame.origin.y){
+                       //\8fã\95Ç\96Ê
+                       this.origin.y = -this.frame.origin.y;
+                       this.movingSpeed.y = -this.movingSpeed.y;
+               } else if(this.origin.y > this.stage.mainCanvas.height - (this.frame.origin.y + this.frame.size.y)){
+                       //\89º\95Ç\96Ê
+                       this.origin.y = this.stage.mainCanvas.height - (this.frame.origin.y + this.frame.size.y);
+                       this.movingSpeed.y = -this.movingSpeed.y;
+               }
+       },
+}
+
index eaf3415..78838a8 100755 (executable)
@@ -271,163 +271,8 @@ GameManager.prototype = {
        },
 };
 
-//
-//ゲームステージ
-//
-
-function GameStage(){
-       //****コンストラクタ****
-       //**インスタンス変数宣言・初期化**
-       //タイマーカウントを初期化
-       this.tickCount = 0;
-       //GameManagerから渡されるプロパティ
-       this.manager = null;
-       this.mainCanvas = null;
-       this.debugCanvas = null;
-       this.mainContext = null;
-       this.debugContext = null;
-       //StageObjectのリスト
-       this.stageObjectList = new Array();
-       //オーバーライドされる可能性のある関数の保存
-       //this.super = new Object();
-       //上記の方法では、thisがsuperになってしまい動作しないので、同一階層に関数の参照を作成することになった。
-       this.super_keyDown = this.keyDown;
-       this.super_keyUp = this.keyUp;
-       this.super_timerTick = this.timerTick;
-       this.super_runStage = this.runStage;
-       this.super_stopStage = this.stopStage;
-       this.super_addStageObject = this.addStageObject;
-       this.super_removeStageObject = this.removeStageObject;
-       //衝突判定用canvas
-       this.collisionMapCanvas = null;
-       this.collisionMapContext = null;
-}
-GameStage.prototype = {
-       //以下の関数をオーバーライドしてステージを作成する。
-       keyDown: function(event){
-               //キー入力
-       },
-       keyUp: function(event){
-               //キー入力
-       },
-       timerTick: function(){
-               //タイマー
-               
-               this.tickCount++;
-               drawText(this.debugContext, "tick:" + this.tickCount, 0, 20);
-               
-               //キャンバスを全消去
-               this.mainContext.clearRect(0, 0, this.mainCanvas.width, this.mainCanvas.height);
-               this.collisionMapContext.clearRect(0, 0, this.collisionMapCanvas.width * 8, this.collisionMapCanvas.height * 8);
-               //全てのオブジェクトを再描画
-               
-               for(i = 0; i < this.stageObjectList.length; i++){
-                       this.stageObjectList[i].display();
-               }
-       },
-       runStage: function(){
-               //ステージ初期化処理
-               this.tickCount = 0;
-               //衝突マップ初期化
-               this.collisionMapCanvas = createCanvas("collisionMapCanvas", this.mainCanvas.width, this.mainCanvas.height, this.mainCanvas.width, 0, 1, "MainArea");
-               this.collisionMapContext = this.collisionMapCanvas.getContext('2d');
-               this.collisionMapContext.fillStyle = "rgba(0,0,0, 0.2)";
-               this.collisionMapContext.strokeStyle = "rgba(0,0,0, 0.2)";
-               this.collisionMapContext.scale(1, 1);
-       },
-       stopStage: function(){
-               //ステージ終了処理
-               destroyDOMObjectByID(this.collisionMapCanvas.id);
-               this.collisionMapCanvas = null;
-               this.collisionMapContext = null;
-               this.stageObjectList = null;
-       },
-       addStageObject: function(aStageObject){
-               //StageObject追加処理
-               this.stageObjectList.push(aStageObject);
-       },
-       removeStageObject: function(aStageObject){
-               //StageObject削除処理
-               removeObjectFromArray(this.stageObjectList, aStageObject);
-       }
-}
 
-//
-//キャラクター
-//
 
-function StageObject(aStage){
-       this.stage = aStage;
-       this.origin = new Point2D(10, 10);
-       //originを中心とした座標でのオブジェクトの描画面のサイズ
-       this.frame = new Rectangle(-8, -8, 16, 16);
-       this.movingSpeed = new Point2D(0, 0);
-       //2 * hysteresis >= movingFrictionであることを推奨する。
-       //そうでない場合、摩擦での減速後に完全に停止できない可能性がある。
-       this.movingFriction = 90;
-       this.hysteresis = this.movingFriction / 2;
-       //実体を持たない、つまり衝突判定が必要ない場合はtrue.
-       this.isPhantom = false;
-       //console.log("StageObject:Init");
-}
-StageObject.prototype = {
-       display: function(){
-               //再描画時に呼ばれる。
-               this.computeTickMoving();
-               this.computeTickFriction();
-               this.computeTickBounding();
-               //弧の描画
-               this.stage.mainContext.save();
-               this.stage.mainContext.fillStyle = "rgba(" + (((11*this.frame.size.x) & 0x7f) + 0x80) + "," + (((19*this.frame.size.x) & 0x7f) + 0x80) + "," + (((17*this.frame.size.x) & 0x7f) + 0x80) + ",0.5)";
-               drawArcDegree(this.stage.mainContext, this.frame.size.x / 2, 0, 360, this.origin.x, this.origin.y, false);
-               this.stage.mainContext.restore();
-               //衝突マップに描画
-               strokeRect(this.stage.collisionMapContext, this.origin.x + this.frame.origin.x, this.origin.y + this.frame.origin.y, this.frame.size.x, this.frame.size.y);
-       },
-       computeTickFriction: function(){
-               //摩擦処理
-               if(this.movingSpeed.x < -this.hysteresis){
-                       this.movingSpeed.x += this.movingFriction / this.stage.manager.tickPerSecond;
-               } else if(this.movingSpeed.x > this.hysteresis){
-                       this.movingSpeed.x -= this.movingFriction / this.stage.manager.tickPerSecond;
-               } else{
-                       this.movingSpeed.x = 0;
-               }
-               if(this.movingSpeed.y < -this.hysteresis){
-                       this.movingSpeed.y += this.movingFriction / this.stage.manager.tickPerSecond;
-               } else if(this.movingSpeed.y > this.hysteresis){
-                       this.movingSpeed.y -= this.movingFriction / this.stage.manager.tickPerSecond;
-               } else{
-                       this.movingSpeed.y = 0;
-               }
-       },
-       computeTickMoving: function(){
-               //運動処理
-               this.origin.x += this.movingSpeed.x / this.stage.manager.tickPerSecond;
-               this.origin.y += this.movingSpeed.y / this.stage.manager.tickPerSecond;
-       },
-       computeTickBounding: function(){
-               //壁面跳ね返り処理
-               if(this.origin.x < -this.frame.origin.x){
-                       //左壁面
-                       this.origin.x = -this.frame.origin.x;
-                       this.movingSpeed.x = -this.movingSpeed.x;
-               } else if(this.origin.x > this.stage.mainCanvas.width - (this.frame.origin.x + this.frame.size.x)){
-                       //右壁面
-                       this.origin.x = this.stage.mainCanvas.width - (this.frame.origin.x + this.frame.size.x);
-                       this.movingSpeed.x = -this.movingSpeed.x;
-               }
-               if(this.origin.y < -this.frame.origin.y){
-                       //上壁面
-                       this.origin.y = -this.frame.origin.y;
-                       this.movingSpeed.y = -this.movingSpeed.y;
-               } else if(this.origin.y > this.stage.mainCanvas.height - (this.frame.origin.y + this.frame.size.y)){
-                       //下壁面
-                       this.origin.y = this.stage.mainCanvas.height - (this.frame.origin.y + this.frame.size.y);
-                       this.movingSpeed.y = -this.movingSpeed.y;
-               }
-       },
-}
 
 //
 //その他のクラス
diff --git a/www/corelib/header.js b/www/corelib/header.js
new file mode 100644 (file)
index 0000000..647b095
--- /dev/null
@@ -0,0 +1,4 @@
+document.write("<script type='text/javascript' src='corelib/jsbase.js'></script>");
+document.write("<script type='text/javascript' src='corelib/core.js'></script>");
+document.write("<script type='text/javascript' src='corelib/classes/GameStageClass.js'></script>");
+document.write("<script type='text/javascript' src='corelib/classes/StageObjectClass.js'></script>");
diff --git a/www/corelib/jsbase.js b/www/corelib/jsbase.js
new file mode 100644 (file)
index 0000000..27268f6
--- /dev/null
@@ -0,0 +1,66 @@
+
+// Javascript \82Ì Class \92è\8b` (function)\82É\8cp\8f³\8b@\94\\82ð\95t\89Á\82·\82é
+Function.prototype.extend = function(baseConstructor) {
+
+       // \94h\90\83N\83\89\83X\82Ì\83R\83\93\83X\83g\83\89\83N\83^\82Ì prototype \83v\83\8d\83p\83e\83B\82É\90Ý\92è
+       var F = function(){};
+       F.prototype = baseConstructor.prototype;
+       
+       this.prototype = new F();
+
+       // \83R\83\93\83X\83g\83\89\83N\83^\82ð\8e¦\82·\83v\83\8d\83p\83e\83B\82ð\90Ý\92è
+       this.prototype.constructor = this;
+       this.base = baseConstructor;
+
+       return this;
+};
+
+/*
+
+//\96¼\91O\82Ì\95t\82¯\95û\82É\82Â\82¢\82Ä
+
+\81E\83N\83\89\83X\93à\82Ì\8aO\95\94\82©\82ç\83A\83N\83Z\83X\82·\82é\95Ï\90\94\81A\8aÖ\90\94\82Í\91å\95\8e\9a
+\81E\8aO\95\94\82©\82ç\83A\83N\83Z\83X\82µ\82È\82¢\95Ï\90\94\82Í\8f¬\95\8e\9a
+\81E\8aO\95\94\82©\82ç\83A\83N\83Z\83X\82µ\82È\82¢\81A\82©\82ÂgetXXX(), setXXX()\82ð\8co\97R\82µ\82Ä\95Ò\8fW\82·\82é\95Ï\90\94\82Í_
+\82Å\82Í\82\82ß\82Ä\82­\82¾\82³\82¢\81B
+\81E\82Ü\82½\81A\83N\83\89\83X\82Í\82·\82×\82ÄClass\82Å\8fI\82í\82Á\82Ä\82­\82¾\82³\82¢\81B
+\81E\82»\82ê\8e©\91Ì\82ðnew\82¹\82¸\81A\8cp\8f³\82Ì\82Ý\82³\82ê\82é\83N\83\89\83X\82ÍBaseClass\82Å\8fI\82í\82ç\82¹\82Ä\82­\82¾\82³\82¢\81B
+
+
+
+//\8eg\82¢\95û
+
+
+var BaseClass = function BaseClass( msg, msg2 )
+{
+       //\82±\82±\82Å\93K\93\96\82È\83\81\83\93\83o\82ð\90é\8c¾
+       this.testval = "hello!";
+};
+BaseClass.prototype.method = function()
+{
+       //\82±\82Ì\8aÖ\90\94\82ª\8eq\83N\83\89\83X\8co\97R\82Å\82æ\82Î\82ê\82é\82Æ this \82Í\8eq\83N\83\89\83X\82ð\8ew\82·\81B
+};
+
+// \94h\90\83N\83\89\83X\82Ì\92è\8b`
+var SubClass = function SubClass()
+{
+       //\89º\82Ì\91æ\93ñ\88ø\90\94\82É\82Í\90e\83N\83\89\83X\82Ì\83R\83\93\83X\83g\83\89\83N\83^\82É\93n\82·\88ø\90\94\82ð\94z\97ñ\82Å\8ew\92è
+       SubClass.base.apply( this , ["ttwilb", "hikarupsp"] );
+       
+       // \82±\82±\82Åthis.\83\81\83\93\83o\96¼ (this.\83\81\83\\83b\83h\96¼)\82Å\90e\83N\83\89\83X\82Ì\83\81\83\93\83o\82É\82à\83A\83N\83Z\83X\82Å\82«\82é
+       
+}.extend( BaseClass ); // BaseClass \82ð\8cp\8f³
+
+var ss = new SubClass();
+
+
+
+// \97á
+
+//\82 \82é\83I\83u\83W\83F\83N\83g\82Ì\90e\83N\83\89\83X\82ð\8eæ\93¾\82·\82é
+
+if(obj.constructor.base == BaseClass)
+
+
+*/
+
index 645deb2..b81d815 100755 (executable)
@@ -7,7 +7,7 @@
 <style type="text/css">
 
 </style>
-<script type="text/javascript" src="./corelib/core.js" charset="UTF-8"></script>
+<script type="text/javascript" src="./corelib/header.js" charset="UTF-8"></script>
 <script type="text/javascript">
 
 var mainManager = null;
diff --git a/www/lab/index.html b/www/lab/index.html
new file mode 100644 (file)
index 0000000..88841ee
--- /dev/null
@@ -0,0 +1,53 @@
+<html>
+<head>
+<title>\83I\83u\83W\83F\83N\83g\8ew\8cü\83e\83X\83g</title>
+<script type="text/javascript">
+
+// \8cp\8f³\82Ì\82½\82ß\82Ì\83\81\83\\83b\83h
+// baseConstructor \82Í\90e\83N\83\89\83X\82Ì\83R\83\93\83X\83g\83\89\83N\83^
+Function.prototype.extend = function( baseConstructor, args ) {
+
+       // \94h\90\83N\83\89\83X\82Ì\83R\83\93\83X\83g\83\89\83N\83^\82Ì prototype \83v\83\8d\83p\83e\83B\82É\90Ý\92è
+       var F = function(){};
+       F.prototype = baseConstructor.prototype;
+       this.prototype = new F();
+
+       // \83R\83\93\83X\83g\83\89\83N\83^\82ð\8e¦\82·\83v\83\8d\83p\83e\83B\82ð\90Ý\92è
+       this.prototype.constructor = this;
+       this.base = baseConstructor;
+       
+       return this;
+};
+
+
+// \90e\83N\83\89\83X\82Ì\92è\8b`
+var BaseClass = function BaseClass( msg, msg2 ) {
+    this.testBase = "hello, " + msg + " and " + msg2;
+       
+};
+BaseClass.prototype.method = function() { console.log(this); };
+
+// \94h\90\83N\83\89\83X\82Ì\92è\8b`
+var SubClass = function SubClass() {
+    // \90e\83N\83\89\83X\82Ì\83R\83\93\83X\83g\83\89\83N\83^\82ð\96¾\8e¦\93I\82É\8cÄ\82Ñ\8fo\82· (\88ø\90\94\82Í\93K\93\96\82É\8ew\92è)
+
+   SubClass.base.apply( this ,  ["ttwilb", "hikarupsp"]  );
+   
+    // \83C\83\93\83X\83^\83\93\83X\95Ï\90\94\82Ì\92è\8b`\82È\82Ç
+    /* ... */
+    
+
+       
+}.extend( BaseClass); // BaseClass \82ð\8cp\8f³
+//SubClass.prototype.method = function() {  };
+
+
+var ss = new SubClass();
+console.log(ss.constructor.base == SubClass);
+//ss.method();
+
+</script>
+</head>
+<body>
+</body>
+</html>