A
Situation: User is pressing mouse button to draw tiles on the screen. it must not print those if mouse_y > x
Piece of cake you say. I also believe that I do everything necessary, but if the user is a real idiot and pulls the mouse very quickly under the limit it will draw those tile under x.
Code:while(!kbhit()) { ... if(mouse_b & 1) { rest(10); // Helps a bit, but stil... /* Draw & set a tile */ if((mouse_x < mapX*PCX_X) && (mouse_y < mapY*PCX_Y)) { scare_mouse(); map.SetTile(mouse_x/PCX_X, mouse_y/PCX_Y, (TILE)tile); // just an insertion to an array map.UpdateTile(mouse_x/PCX_X, mouse_y/PCX_Y); // -> blit unscare_mouse(); } ... }
B
How to get other than US-layout for the keyboard? (And how to work with that `install_keyboard_hooks()'?)



LinkBack URL
About LinkBacks





