Re: A89: Delays, how do you create them


Re: A89: Delays, how do you create them

ngetchx() WAITS for a keypress, that is the problem...
use kbhit() instead; it checks for a keypress and then continues
you may want to flush the keypress buffer when your done though...

hope this helps,
All parts should go together without forcing. You must remember that the
parts you are reassembling were disassembled by you. Therefore, if you can't
get them together again, there must be a reason. By all means, do not use a
-- IBM maintenance manual, 1925

----- Original Message -----
Sent: Sunday, February 18, 2001 5:53 PM
Subject: Re: A89: Delays, how do you create them

Yes I did check that header file out.  I came up with the following code
is SUPPOSED to make a small arrow blink but it doesnt.  Heres the code:

//begin code snippit

static unsigned char arrow[]=
    { 0xFE, 0x82, 0x44, 0x28, 0x10, 0x0, 0x0, 0x0};//the arrow sprite

OSFreeTimer(USER_TIMER);//free the user timer for use
OSRegisterTimer(USER_TIMER,2*20);//register the user timer for 2 seconds
Sprite8(80,90,8,arrow,LCD_MEM,SPRT_XOR);//put the arrow sprite on the screen
while(!ngetchx())//while no keys are pressed excute the following code
    if(OSTimerExpired(USER_TIMER))//if the user timer is expired excute the
        Sprite8(80,90,8,arrow,LCD_MEM,SPRT_XOR);//XOR the sprite to the
    }//end if
}//end while
//end code snippit

Can you tell me why that doesnt work?  Is it something with the while loop
ngetchx() function conflicting with the timers?  (just a thought)  Well if
you can help me i would GRREATLY appreciate it as i could continue with
making my game.

Thanks again!,

Do You Yahoo!?
Get your free address at