背景の移動 ふるいむかし


グローバル
int back,parts1; int px = 0; int py = 0; int gw,gh;
// ******************************************************** // 背景描画 ( 最初に描画 ) // ******************************************************** // 左上 DrawRectGraph( 0, 0, gw-px, py, px, gh-py, back, false, false ) ; // 右上 DrawRectGraph( px, 0, 0, py, gw, gh-py, back, false, false ) ; // 左下 DrawRectGraph( 0, gh-py, gw-px, 0, px, gh, back, false, false ) ; // 右下 DrawRectGraph( px, gh-py, 0, 0, gw, gh, back, false, false ) ;
double toRad;
// 左上
if ( px > 800 ) {
toRad = atan2( p.y+32 - (gh - py - 200), p.x+32 - (px - gw + 40) );
toRad -= 3.14/2;
DrawRotaGraph( px - gw + 40, gh - py - 200,
1, toRad,
parts1, true , false ) ;
}
else {
toRad = atan2( p.y+32 - (gh - py - 200), p.x+32 - (px + 40) );
toRad -= 3.14/2;
DrawRotaGraph( px + 40, gh - py - 200,
1, toRad,
parts1, true , false ) ;
}
py--;
if ( py < 0 ) {
py = gh;
}
// 右へ移動
if ( p.right ) {
p.Move( PAD_INPUT_RIGHT, 3 );
px -= 3;
if ( px < 0 ) {
px = gw;
}
}
// 左へ移動
if ( p.left ) {
p.Move( PAD_INPUT_LEFT, 3 );
px += 3;
if ( px > gw ) {
px = 0;
}
}

ダウンロードページ