OSDN Git Service

とげとげ
[h58pcdgame/GameScriptCoreLibrary.git] / www / corelib / classes / EnemyCharacters / EnemyCharacterClass_Spine.js
1 var EnemyCharacterClass_Spine = function(stage, args){
2     EnemyCharacterClass_Spine.base.apply(this,[stage,[["toge.png",]]]);
3
4 this.size.x = 32;
5 this.size.y = 32;
6 this.collisionMargin.top = 28;
7 this.chasingRange = 0;
8 this.movingVelocity =0;
9 this.hurt=0;
10 this.touchDamege=10;
11 this.damagePerTickBase = 30;
12 this.max_HP = 2000;
13 if(this.collidingDirection & (CollideLeft | CollideRight | CollideTop)){
14         if(!this.damaging){
15                 //メインキャラクタへのダメージ有効
16                 this.damaging = true;
17                 this.damagePerTickCount = this.damagePerTickBase;
18         }
19 }
20 stage.addStageObject(this);
21 }.extend(EnemyCharacterClass, {
22         className: "EnemyCharacterClass_Spine",
23
24         objectAttacked : function(obj, obj_x, obj_y)
25         {
26                 if(obj instanceof MainCharacterClass)
27                 {
28                         //メインキャラクターに衝突された
29                         //ダメージの開始・終了処理
30                         if(this.collidingDirection & (CollideLeft | CollideRight | CollideTop)){
31                                 if(!this.damaging){
32                                         //メインキャラクタへのダメージ有効
33                                         this.damaging = true;
34                                         this.damagePerTickCount = this.damagePerTickBase;
35                                 }
36                         }
37                         this.lastCollidedTick = this.ownerStage.manager.tickCount;
38                 }
39         },
40 });