Path: chuka.playstation.co.uk!news From: "David Smethurst" Newsgroups: scea.yaroze.programming.2d_graphics,scee.yaroze.freetalk.english Subject: Re: Controlling the PAD... Date: Thu, 20 Aug 1998 09:29:52 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 62 Message-ID: <6rgmt1$l2e20@chuka.playstation.co.uk> References: <6rgb76$g19@scea> NNTP-Posting-Host: 195.152.73.89 X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Xref: chuka.playstation.co.uk scea.yaroze.programming.2d_graphics:406 scee.yaroze.freetalk.english:1842 Steve Tolin wrote in message <6rgb76$g19@scea>... >I don't know if anyone has asked this yet.... > >How would you register a double tap on the d-pad??? > >Let's say holding down on pad makes character duck > if (PadStatus&PADdown) > { >// printf("You just pressed the D-PAD: DOWN\n"); > AnimateDucking(); > } > > >What would have to go in here??? > > if (PadStatus&*******************) > { >// printf("You just pressed the D-PAD: DOWN\n"); > AnimateCrouch(); > } I think the only way you would be able to do this is by having a timer - i.e. static short iTimer=0; static short iLast=-1; if( PadStatus&PADdown) { printf("You just pressed the D-PAD: DOWN\n"); if( iLast == -1 ) { iLast = iTimer; printf("First press\n"); } else { // take it that we want it to be pressed twice within 5 updates // you will have to alter this according to how fast you need to do // the double press if( iTimer - iLast < 5 ) { AnimateCrouch(); iTimer = 0; iLast = -1; } } } if( iLast != -1 ) iTimer++; This should help. If not just drop me an email D. -- dave@ulthwe.demon.co.uk ICQ: 244386