!ô Bounce.bbc 0.02 28-May-2005 %ô Bounce a card around the screen ô Press SPACE to end program :  "CardLib.bbc" : ô Setup òcdtInit : ô Disable cursor ‡ : ô Turn off screen update òcdtRedraw(£) : ô Read current client area Þ rect% 16 $ "GetClientRect", @hwnd%, rect% 5xmax%=rect%!8-cdtWidth%:ymax%=rect%!12-cdtHeight% : ô Initialise variables >x%=³(xmax%):y%=³(ymax%):xs%=1:ys%=1:oldtime=‘-100:moved%=£ : +ô Set flag if the window has been moved î ì moved%=@msg%:ø : ô Main loop õ : ô Change card every 50cs +ç ‘-oldtime>=50 card%=³(52)-1:oldtime=‘ : ô Remove the last card /òcdtDraw(@memhdc%,x%,y%,1,mdRemove,&FFFFFF) : ô Move cardx x%+=xs%:y%+=ys% : ô Draw card -òcdtDraw(@memhdc%,x%,y%,card%,mdFaceUp,0) : ô Redraw screen NòcdtRedrawArea(x%-”(xs%),y%-”(ys%),cdtWidth%+”(xs%*2),cdtHeight%+”(ys%*2)) : ô Read new client area ç moved%=5 Œ $ "GetClientRect", @hwnd%, rect% >xmax%=rect%!8-cdtWidth%:ymax%=rect%!12-cdtHeight%:moved%=0 Í : 1ô Check for card bounce and update directions ç y%>=ymax% „ y%<0 ys%=-ys% ç x%>=xmax% „ x%<0 xs%=-xs% : ý ¦(0)=32 : ô Finish using the DLL òcdtTerm : ô Enable cursor î : ô Done à ÿÿ