±â¸» °ÔÀÓ°úÁ¦¿¡ ¸·È÷´Â ºÎºÐÀÌ ÀÖ¾î¼ Áú¹® µå¸³´Ï´Ù
int main ÀÇ ¸Ç ¸¶Áö¸·ÀÇ
while (1) {
player_jump(&x, &y);
player_move(&x, &y);
attact(&x, &y);
} °¡ ¹®Á¦ÀÔ´Ï´Ù.
µð¹ö±ëÀ» ÇغÃÀ»¶§ ¼ø¼´ë·Î Àß µ¹±ä ÇÕ´Ï´Ù. ±×·±µ¥ Á¦°¡ Å°¸¦ ´©¸£´Â °Í°ú whileÀÇ ·çÇÁÀÇ ¼ø¼°¡ ÇÕÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù.
±×·¯´Ï±î Á¦°¡ player_move(&x, &y)ÂÊ¿¡ ¿øÇÏ´Â ÀÔ·ÂÀÌ ÀÖ¾î¼ ¹æÇâÅ°¸¦ ´·¶´Âµ¥ ÄÄÆÄÀÏÀº player_move(&x, &y)°¡ ¾Æ´Ñ player_jump(&x, &y) ºÎºÐ¿¡ ÀÖ¾î¼
Á¦ ÀÔ·ÂÀ» ¹Þ¾ÆµéÀÌÁö¸¦ ¸øÇÕ´Ï´Ù.
ÄÄÇ»ÅÍ°¡ whileÀÇ ·çÇÁ¸¦ °è¼Ó ºùºù µ¹´Ù°¡ player_move(&x, &y)¿¡ ¿À´Â ŸÀֿ̹¡ µü È»ìÇ¥¸¦ ´©¸¦ ¼öµµ ¾ø´Â ³ë¸©ÀÌ°í.. ms´ÜÀ§·Î ¸Å¿ì ºü¸£°Ô µ¹¾Æ¼ ¾î´ÀÁ¤µµ ¹Þ¾ÆµéÀ̱â´Â Çϴµ¥ ¾à°£ ²÷¾îÁö´Â °ÍÀÌ ÀÖ½À´Ï´Ù. °Ô´Ù°¡ Àú·¸°Ô attactÀ» ³ÖÀ¸¸é 2ms¸¦ ÁÖ±â·Î ·çÇÁ¸¦ µ¹´ø °ÍÀÌ 100ms·Î ÁֱⰡ ´Ã¾î³ª¼.. ºü¸£°Ô µ¹Áöµµ ¾Ê½À´Ï´Ù. ¾î¶»°Ô ÇØ°áÇØ¾ß ÇÒ±î¿ä,,?