// 以下变量只需要初始化一次
static int iInitedHookPos = 0;
if( 0 == iInitedHookPos )
{
iInitedHookPos = 1;
// 钩子初始位置值初始化
g_fHookStartPosX = dGetSpritePositionX( "GoldHook" );
g_fHookStartPosY = dGetSpritePositionY( "GoldHook" );
// 金子可以出现的边界范围初始化
g_iGoldBornMinX = dGetWorldLeft() + 5;
g_iGoldBornMaxX = dGetWorldRight() - 5;
g_iGoldBornMinY = dGetWorldTop() + 20;
g_iGoldBornMaxY = dGetWorldBottom() - 5;
}
2019-12-21 20:28:41
3.59MB
C语言
1