Monthly Archives: 10月 2005 - Page 2

アイテム欄

08aec85b.gif
地味に壁厚そうっス。
うーぬ。
配列かねぇ・・・?

方向転換、追尾、回避(命中)

追跡者まだまだ追いかける
更にまだまだ追いかける更にしつこくまだまだ追いかk(ry
オート方向転換・オート追尾・回避(命中)
第一の厚壁、突破!!!!
方向転換:自分と比較対象2点のx,yの差を調べ角度を出し、
      ある角度なら下向きにしたり上向きにしたり。
追尾:ラジアン・三平方の定理で距離算出。
    ある程度離れると追尾。ある程度近づくと攻撃開始。
回避:ランダム数値0~100生成して、30以上が出ると命中みたいな。
ここで出るかー!と思ったのが平方根
高校の頃、将来絶対使わないと思ってたのにw
敵の動作はパッシブモンスターと同じ動作になってます。おおよそ。

スケルトンアックスMC

座標から方向を取得するため、書き換えが必要に。
ちょっと手間取ってます。
しばらく記述載せてなかったんで、旧スケルトンアックスMCのスクリプト載せときますネ。
if文サイコー
—-
onClipEvent (load) {
HP = 10;
attack_direction = “none”;
dead_direction = “none2”;
nockback_direction = “none3”;
attack_direction_hit = “hit”;
//
}
onClipEvent (enterFrame) {
if (HP>1 && HP<10) { rad = Math.atan2(this._parent.deathknight._y-this._y, this._parent.deathknight._x-this._y); enemy_rotations = rad*180/Math.PI; } } onClipEvent (enterFrame) { if (HP>0) {
if (this.hitTest(this._parent.deathknight.attack_top.hitter)) {
this._parent.chatbox.supermes += “スケルトンアックスに(ダメージ表示)のダメージを与えました。”+”r”;
this._parent.chatbox.supermes.scroll += 2;
HP -= 2;
attack_direction = “attackbottom”;
dead_direction = “deadbottom”;
nockback_direction = “nockbackbottom”;
} else if (this.hitTest(this._parent.deathknight.attack_bottom.hitter)) {
this._parent.chatbox.supermes += “スケルトンアックスに(ダメージ表示)のダメージを与えました。”+”r”;
this._parent.chatbox.supermes.scroll += 2;
HP -= 2;
attack_direction = “attacktop”;
dead_direction = “deadtop”;
nockback_direction = “nockbacktop”;
} else if (this.hitTest(this._parent.deathknight.attack_left.hitter)) {
this._parent.chatbox.supermes += “スケルトンアックスに(ダメージ表示)のダメージを与えました。”+”r”;
this._parent.chatbox.supermes.scroll += 2;
HP -= 2;
attack_direction = “attackright”;
dead_direction = “deadright”;
nockback_direction = “nockbackright”;
} else if (this.hitTest(this._parent.deathknight.attack_right.hitter)) {
this._parent.chatbox.supermes += “スケルトンアックスに(ダメージ表示)のダメージを与えました。”+”r”;
this._parent.chatbox.supermes.scroll += 2;
HP -= 2;
attack_direction = “attackleft”;
dead_direction = “deadleft”;
nockback_direction = “nockbackleft”;
}
}
}
onClipEvent (enterFrame) {
if (HP<1) { HP = "dead_delay"; } else if (HP == "dead_delay") { this._parent.chatbox.supermes += "スケルトンアックスを倒しました。“+”r”;
this._parent.chatbox.supermes += “アデナ(数)、EXP(数)を取得。“+”r”;
this._parent.chatbox.supermes.scroll += 2;
this._parent.state_box.PlayerNowEXP += 10.5;
HP = “mobdead”;
}
}
onClipEvent (enterFrame) {
if (HP>1 && HP<9) { if (attack_direction == "attackbottom") { this.gotoAndStop("attack_bottom"); if (attack_direction_hit == "hit") { this._parent.enemy_attack_hit._x = this._x; this._parent.enemy_attack_hit._y = this._y; this._parent.enemy_attack_hit.gotoAndPlay("hit_bottom_f"); attack_direction_hit = "hitted"; attack_direction = "bottom"; } if (attack_direction == "bottom") { if (_parent.deathknight.PlayerHP<=0) { this.gotoAndStop("stand_bottom"); } else { attack_direction = "attackbottom"; } } } else if (attack_direction == "attacktop") { this.gotoAndStop("attack_top"); if (attack_direction_hit == "hit") { this._parent.enemy_attack_hit._x = this._x; this._parent.enemy_attack_hit._y = this._y; this._parent.enemy_attack_hit.gotoAndPlay("hit_top_f"); attack_direction_hit = "hitted"; attack_direction = "top"; } if (attack_direction == "top") { if (_parent.deathknight.PlayerHP<=0) { this.gotoAndStop("stand_top"); } else { attack_direction = "attacktop"; } } } else if (attack_direction == "attackright") { this.gotoAndStop("attack_right"); if (attack_direction_hit == "hit") { this._parent.enemy_attack_hit._x = this._x; this._parent.enemy_attack_hit._y = this._y; this._parent.enemy_attack_hit.gotoAndPlay("hit_right_f"); attack_direction_hit = "hitted"; attack_direction = "right"; } if (attack_direction == "right") { if (_parent.deathknight.PlayerHP<=0) { this.gotoAndStop("stand_right"); } else { attack_direction = "attackright"; } } } else if (attack_direction == "attackleft") { this.gotoAndStop("attack_left"); if (attack_direction_hit == "hit") { this._parent.enemy_attack_hit._x = this._x; this._parent.enemy_attack_hit._y = this._y; this._parent.enemy_attack_hit.gotoAndPlay("hit_left_f"); attack_direction_hit = "hitted"; attack_direction = "left"; } if (attack_direction == "left") { if (_parent.deathknight.PlayerHP<=0) { this.gotoAndStop("stand_left"); } else { attack_direction = "attackleft"; } } } } } onClipEvent (enterFrame) { if (HP !== "dead_delay") { if (HP !== "mobdead") { if (nockback_direction == "nockbackbottom") { this.gotoAndStop("nockback_bottom"); nockback_direction = "none3"; } else if (nockback_direction == "nockbacktop") { this.gotoAndStop("nockback_top"); nockback_direction = "none3"; } else if (nockback_direction == "nockbackright") { this.gotoAndStop("nockback_right"); nockback_direction = "none3"; } else if (nockback_direction == "nockbackleft") { this.gotoAndStop("nockback_left"); nockback_direction = "none3"; } } } } onClipEvent (enterFrame) { if (HP == "mobdead") { if (dead_direction == "deadbottom") { this.gotoAndStop("dead_bottom"); } else if (dead_direction == "deadtop") { this.gotoAndStop("dead_top"); } else if (dead_direction == "deadright") { this.gotoAndStop("dead_right"); } else if (dead_direction == "deadleft") { this.gotoAndStop("dead_left"); } } }

光が見えた

rotation1rotation2
気がする。

HP MP EXP LV

28cc2c25.JPGHP、MP、EXP、LV連動表示
やっとこさ左下のインターフェイスがちょっとだけ形に。
インターフェイスの山場はショートカットにアイテムドラッグドロップかなぁ、
んでアイテム欄も。
ステータスやら武器パラメータはちょっと後回し。
STRのみ補正かけるようにセッティングしたけど、どうもうまくいかず。
概念しっかり考えないと乗せられないっぽいっす。
そろそろ後回しにしてきた壁ども(オート方向転換、オート追尾、回避)と向き合う時がやってきました。
イメージは頭の中にありますが、それをどう処理するのかが問題ですね。
p.s.
メッセージのログ削除ら辺り、変数に空白いれればいいんスね。
何をトチ狂ってマイナスなんか入れたのだろう。

ぶっちゃけ

HP減りingびよーん
瞬殺でHP表示連動、完成
よくFLASH読み込み中にある、プログレスバーを流用してみました。

CPU使用率100%ナリ

dd33881a.gifちょっと動作テストで学校のPCで起動させて見たんですが、この有様っす。
動作自体は画像ファイルを流してるだけなんで、トゥイーンやらシェイプよりは軽くなるはずなんやけどなぁ。
家戻ってからブリブリしながらテストテストテスト。
Doやらリネらしく雰囲気をかもし出した、メッセージ欄に問題があるようです。
とりあえず文字だけ増えるよう設定して増殖させまくると、CPU使用率がグングンうp。
テキストの癖になんだねコレはw
メッセージ自体は + で次から次へと追加してるんで、- なら消えるんじゃねぇの?
と思いおもむろに
on(press){
supermes -= ” “;
}
パブリッシュ、パブリッシュ♪
┌─────────────
│スケルトンアックスに(ダメージ表示)のダメージを与えました。
│スケルトンアックスに(ダメージ表示)のダメージを与えました。
│スケルトンアックスに(ダメージ表示)のダメージを与えました。
│スケルトンアックスに(ダメージ表示)のダメージを与えました。
│スケルトンアックスに(ダメージ表示)のダメージを与えました。
│スケルトンアックスに(ダメージ表示)のダメージを与えました。
└─────────────
  ↓
 出来たボタンをポチリとプッシュ
  ↓
┌─────────────
│NaN





└─────────────
おそらく物凄い勢いで間違ってるんだろうと思いますが、ログの削除に成功!
この後、一定のログ数になると削除されるように設定しておきました。
が、起動するだけでCPU10%くらい削られるのは内緒にしておきますネ:P

反撃(今んとこ回避無し)

ノックバック
とりあえず攻撃を受けた方向に向きなおして反撃するようになりました。
タイトルどおり、回避の概念まだつっこんで無いんで100%命中。
敵(アックス)は攻撃を受けた方向むきっぱなしで攻撃連射してくるんで、
うまく背後に回ってズシャ!
また背後に回ってズシャ!
んで背後にm(ry
・・・
先生!避けゲーになってます!
死亡
てか、アックスつえー
NEXT
範囲外に出ると攻撃やめて追尾するとか、
攻撃を受けた方向じゃなくて、今居る場所をリアルタイムで追いかけて方向転換するとか、目標。
三角関数を使う予感です。
HP表示連動のが簡単そうだから先やってしまうくさい。
復活
復活もあるでよ。

難航

13e7804b.gif反撃と振り向きでかなり詰まってます。

相対

duplicateナンタラでのけぞりが止まらない!!!て書きましたが、
▽のけぞった後に立ち止まった動作に移るスクリプト
this.gotoAndStop(“this._parent.stand_top”);
上記の様に書いてたのですが、
this.gotoAndStop(“_parent.stand_top”);
とthisを削ってみたところ、アッサリ動作するように。
・・・
何この脱力感。