Ok very annoying problem, need assistance here...

Dec 23, 2010 at 10:44pm
closed account (3pj6b7Xj)
I'm trying to have the Enter key as my pause key for my Squibbles game. The problem i'm having is, at the main menu the enter key stays in the queue of messages and causes the game to start paused! I tried using PeekMessage to automatically clear up the queue before entering the main game loop but it still does the same thing. I ended switching the pause key from enter to the space bar which is ok I guess but I still would like to know why this happens and if there is any way to ... how can I say this ... how about properly do it? I'm not asking for a fix or a way around it, I just need to know why its behaving this way and I can probably find a way to code it another way but right now, I am clueless as to why its behaving this way, I'm assuming its staying in the key but if I run PeekMessage with PM_REMOVE I would expect the queue to be clean and this should not cause the game to pause, some how the proc is picking it up!
Dec 24, 2010 at 8:24am
Colour me stuipd - but are we talking about a console or a windows GUI program here?
Dec 24, 2010 at 8:30am
closed account (3pj6b7Xj)
windows GUI program see my post --- http://cplusplus.com/forum/windows/33413/ for a preview. Thanks.
Dec 24, 2010 at 8:40am
Any code we can peruse/tinker with?
Dec 24, 2010 at 8:40am
Any code we can peruse/tinker with?

P.S - I promise not to steal or it or do anything weird/bad like that
Last edited on Dec 24, 2010 at 8:41am
Dec 24, 2010 at 9:58am
closed account (3pj6b7Xj)
The core of the game is all in the Snake class but theres quite a number of files the game uses; createapp.h, gamedata.h, leveldata.h, texthdc.h, snake.h, snakefood.h, menusystem.h and finally squibbles.cpp...oh i forgot createapp.cpp, gamedata.cpp, leveldata.cpp, texthdc.cpp, snake.cpp, snakefood.cpp, menusystem.cpp ...... lol do you really want to see over two-thousand lines of code?
Dec 24, 2010 at 11:40am
2000 lines is nothing :-)
Dec 25, 2010 at 2:07am
closed account (3pj6b7Xj)
I forgot a 0
Topic archived. No new replies allowed.