OSDN Git Service

とげとげ
authorisuke <namahage.toshi@gmail.com>
Tue, 27 Aug 2013 05:38:38 +0000 (14:38 +0900)
committerisuke <namahage.toshi@gmail.com>
Tue, 27 Aug 2013 05:38:38 +0000 (14:38 +0900)
www/corelib/classes/EnemyCharacters/EnemyCharacterClass_Spine.js [new file with mode: 0644]
www/corelib/header.js
www/stage/okubo.js

diff --git a/www/corelib/classes/EnemyCharacters/EnemyCharacterClass_Spine.js b/www/corelib/classes/EnemyCharacters/EnemyCharacterClass_Spine.js
new file mode 100644 (file)
index 0000000..bfdca92
--- /dev/null
@@ -0,0 +1,40 @@
+var EnemyCharacterClass_Spine = function(stage, args){
+    EnemyCharacterClass_Spine.base.apply(this,[stage,[["toge.png",]]]);
+
+this.size.x = 32;
+this.size.y = 32;
+this.collisionMargin.top = 28;
+this.chasingRange = 0;
+this.movingVelocity =0;
+this.hurt=0;
+this.touchDamege=10;
+this.damagePerTickBase = 30;
+this.max_HP = 2000;
+if(this.collidingDirection & (CollideLeft | CollideRight | CollideTop)){
+       if(!this.damaging){
+               //メインキャラクタへのダメージ有効
+               this.damaging = true;
+               this.damagePerTickCount = this.damagePerTickBase;
+       }
+}
+stage.addStageObject(this);
+}.extend(EnemyCharacterClass, {
+       className: "EnemyCharacterClass_Spine",
+
+       objectAttacked : function(obj, obj_x, obj_y)
+       {
+               if(obj instanceof MainCharacterClass)
+               {
+                       //メインキャラクターに衝突された
+                       //ダメージの開始・終了処理
+                       if(this.collidingDirection & (CollideLeft | CollideRight | CollideTop)){
+                               if(!this.damaging){
+                                       //メインキャラクタへのダメージ有効
+                                       this.damaging = true;
+                                       this.damagePerTickCount = this.damagePerTickBase;
+                               }
+                       }
+                       this.lastCollidedTick = this.ownerStage.manager.tickCount;
+               }
+       },
+});
\ No newline at end of file
index 0d53cf6..3d57f56 100644 (file)
@@ -28,6 +28,7 @@ document.write("<script type='text/javascript' src='corelib/classes/EnemyCharact
 document.write("<script type='text/javascript' src='corelib/classes/EnemyCharacters/EnemyCharacterClass_Frog.js'></script>");
 document.write("<script type='text/javascript' src='corelib/classes/EnemyCharacters/EnemyCharacterClass_PanTank.js'></script>");
 document.write("<script type='text/javascript' src='corelib/classes/EnemyCharacters/EnemyCharacterClass_Rat.js'></script>");
+document.write("<script type='text/javascript' src='corelib/classes/EnemyCharacters/EnemyCharacterClass_Spine.js'></script>");
 document.write("<script type='text/javascript' src='corelib/classes/MainCharacterClass.js'></script>");
 document.write("<script type='text/javascript' src='corelib/classes/MainCharacters/MainCharacterClass_Hunter.js'></script>");
 document.write("<script type='text/javascript' src='corelib/classes/MainCharacters/MainCharacterClass_Man.js'></script>");
index 9f6c448..c054a85 100755 (executable)
@@ -42,7 +42,7 @@ var stgObjects = {
     z : {base:SlopeBlockClass,args:['1164.png',33,-3],prop:{enableDebugMode:true}},
    aa : {base:SlopeBlockClass,args:['fence.png',600,600],prop:{enableDebugMode:true}},
    ad : {base:SlopeBlockClass,args:['fence.png',16,16],prop:{enableDebugMode:true}},
-   ae : {base:SlopeBlockClass,args:['toge.png',28,28],prop:{enableDebugMode:true}},
+   ae : {base:EnemyCharacterClass_Spine,args:[]},
    af : {base:SlopeBlockClass,args:['toge.png',0,0],prop:{enableDebugMode:true}},
 
     // FreeItemClass : キャラが取得するとコールバックが実行されるアイテム
@@ -53,6 +53,8 @@ var stgObjects = {
     ac : {base:FreeItemClass,args:["bridgedameged.png",callBack],prop:{times:1,DebugMode:true,}},
     ah : {base:FreeItemClass,args:["stop.png",callBack1],prop:{times:1,DebugMode:true,}},
     
+    
+    
 
     // 何もブロックを置かない位置のためにかならずこのようなエントリーを記述
     _ : null
@@ -68,7 +70,7 @@ function callBack0(obj,x,y)
 
 function callBack(obj,x,y)
 {
-       if(obj instanceof MainCharacterClass){mainManager.addWidget(new MessageWidgetClass(mainManager, ["ガタッ\nそのはかなげな音が聞こえると同時に\n俺は刹那に恐怖を覚えた\nこれが、死ぬという事なのか、、、\nその思いを胸にしまいながら、\n俺は遠くなる橋桁を眺め続けた\n"]));
+       if(obj instanceof MainCharacterClass){mainManager.addWidget(new MessageWidgetClass(mainManager, ["ガタッ\n"]));
 
        }
 };
@@ -122,7 +124,7 @@ stage.runStage = function(){
        main.origin.x = 0;
        main.origin.y = 0;
 
-       var e1 = new MainCharacterClass_PanTank(stage);
+       var e1 = new EnemyCharacterClass_PanTank(stage);
        e1.origin.x = 2800;
        e1.origin.y = 0;
        
@@ -158,26 +160,16 @@ stage.runStage = function(){
        e8.movingVelocity = 70;
 
        var e9 = new EnemyCharacterClass_Rat(stage);
-       e9.size.x = 32;
-       e9.size.y= 32;
        e9.origin.x =5564;
        e9.origin.y = 0;
        e9.chasingRange = 270;
        e9.movingVelocity = 70;
 
-       var e10 = new EnemyCharacterClass(stage, [["toge.png",]]);
-       e10.size.x = 32;
-       e10.size.y=   32;
+       var e10 = new EnemyCharacterClass_Spine(stage);
        e10.origin.x =3936;
        e10.origin.y =383;
-       e10.chasingRange = 0;
-       e10.ownerUID = stage.manager.userID;
-       e10.movingVelocity = 0;
-       e10.touchDamage = 10;
-       e10.hurt = 0;
        e10.collisionMarginTop = 28;
-       e10.hurting = false;
-       stage.addStageObject(e10);
+       
        
        var c1 = new EnemyCharacterClass(stage, [["cowm1.png","cowm2.png","cowm3.png","cowm4.png","cowm3.png","cowm2.png",]]);
        c1.size.x = 100;