//scenario.h
//会話イベントはここに書きます
//このファイルはanalyze.cpp以外でインクルードしないでください
char CMD_BUF[] = {
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
};
そしてタブによって処理を変えていきます。
//analyze.cpp
//scenario.hの命令の解析はここで行います。
void txt_Analyze( void )
{
//キーの入力フラグがtrueのときは命令なし
if( WAIT == true ){
return;
}
//文末に着いたら処理しない
if( CMD_BUF[txt_index] == '\0' ){
return;
}
//読み込みの開始と終了
///////////////////////////////////////////////////////////////
if( strncmp( &CMD_BUF[txt_index] , "" , 6 ) == 0 ){
txt_index += 6;
return;
}
if( strncmp( &CMD_BUF[txt_index] , "" , 5 ) == 0 ){
DrawFormatString( 0 , 60 , GetColor(255,255,255) , "読み込み終了" );
return;
}
///////////////////////////////////////////////////////////////
//立ち絵の表示フラグ
///////////////////////////////////////////////////////////////
if( strncmp( &CMD_BUF[txt_index] , "" , 7 ) == 0 ){
txt_index += 7;
show_flag.player = 1;
return;
}
if( strncmp( &CMD_BUF[txt_index] , "" , 7 ) == 0 ){
txt_index += 7;
show_flag.boss_1 = 1;
return;
}
///////////////////////////////////////////////////////////////
//立ち絵の表示番号
///////////////////////////////////////////////////////////////
if( strncmp( &CMD_BUF[txt_index] , "" , 7 ) == 0 ){
txt_index += 7;
g_point.player = 0;
return;
}
if( strncmp( &CMD_BUF[txt_index] , "" , 7 ) == 0 ){
txt_index += 7;
g_point.player = 1;
return;
}
if( strncmp( &CMD_BUF[txt_index] , "" , 7 ) == 0 ){
txt_index += 7;
g_point.player = 2;
return;
}
if( strncmp( &CMD_BUF[txt_index] , "" , 7 ) == 0 ){
txt_index += 7;
g_point.boss_1 = 0;
return;
}
if( strncmp( &CMD_BUF[txt_index] , "" , 7 ) == 0 ){
txt_index += 7;
g_point.boss_1 = 1;
return;
}
if( strncmp( &CMD_BUF[txt_index] , "" , 7 ) == 0 ){
txt_index += 7;
g_point.boss_1 = 2;
return;
}
///////////////////////////////////////////////////////////////
//吹き出しの位置
///////////////////////////////////////////////////////////////
if( strncmp( &CMD_BUF[txt_index] , "" , 10 ) == 0 ){
txt_index += 10;
ball_x = 200;
ball_y = 300;
ball_point = 0;
return;
}
if( strncmp( &CMD_BUF[txt_index] , "" , 10 ) == 0 ){
txt_index += 10;
ball_x = 50;
ball_y = 300;
ball_point = 1;
return;
}
if( strncmp( &CMD_BUF[txt_index] , "" , 9 ) == 0 ){
txt_index += 9;
Serif_cnt++;
return;
}
///////////////////////////////////////////////////////////////
//アルファブレンド値
///////////////////////////////////////////////////////////////
if( strncmp( &CMD_BUF[txt_index] , "" , 8 ) == 0 ){
if( b_alpha >= 255 ){
txt_index += 8;
}
if( b_alpha " , 8 ) == 0 ){
if( b_alpha = 127 ){
b_alpha -= 10;
}
b_x = 250;
return;
}
if( strncmp( &CMD_BUF[txt_index] , "" , 8 ) == 0 ){
if( p_alpha >= 255 ){
txt_index += 8;
}
if( p_alpha " , 8 ) == 0 ){
if( p_alpha = 127 ){
p_alpha -= 10;
}
pl_x = -100;
return;
}
///////////////////////////////////////////////////////////////
//がきたらフラグをtrueに
if( strncmp( &CMD_BUF[txt_index] , "" , 6 ) == 0 ){
txt_index += 6;
WAIT = true;
return;
}
}
プレイヤーサイドが喋るとき、ボスが喋るときで
吹きだしとアルファ値を別々にコントロールします。
これの読み込みフラグをボスのいる地点、座標に着いたときに
1にしてプログラム始動。
タブを使って操作するところがHAMLっぽくて面白いです。
文字配列なので文が長いほどメモリ食うのが難点