[gameprogrammer] Re: Need for comment & suggestion : Night Raid

  • From: Scott Harper <lareon@xxxxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Sat, 17 Sep 2005 03:26:46 -0600

That works well for you as the developer, but as a gamer -- unless the UI is VERY specific about this -- I assume that if I press ESC once, it toggles paused/menu mode. If I press ESC again, it'll toggle it back off. It's been hard for me over the years to learn that something which works REALLY nicely from a code standpoint is often VERY far from what the user is going to expect. We're just saying this because we know you'll get bunches of emails asking for that change anyway.

--Scott

On 16 Sep, 2005, at 5:33 PM, Dominic McDonnell wrote:

I think completely the opposite. If you think of it as the first press quits the game loop and the second quits the program it is completely solid. And I can tell you it is the most annoying thing in the world to have to press another key when you want to quit. A good design principle is to be able to just press the escape key until the game quits.

What I do is I have the main game loop as a single state machine with the states basically being :

initialisation
game
pause

I use direct x so at the start of the cycle I collect the key state. At the same time I save the previous state so that I can compare them. In the game state I check the escape key, and if it is down I switch to pause mode. In the next and preceding cycles (in pause mode) I check the previous state of the escape key. If it wasn't pressed last cycle and is pressed this cycle I quit the main loop. If another key is pressed (with the same condition that the key wasn't down last time) I change the state back to game.

Hope this helped.

Dominic McDonnell

On Fri, 16 Sep 2005 12:09:13 -0600, Ken Johnson <johnsk16@xxxxxxxxx> wrote:


Also typically, as far as a UI design goes, your giving ESC 2 functions,
one, to pause the game, and the second, the quit the game. It should be ESC
to pause/unpause, and a different keystroke to actually quit the game.
Imagine if you had to hit the uparrow to move forward, but if you hit it
again it moved you left... your just confusing the user.



On 9/15/05, nickhowes@xxxxxxxxxxxxxxxx <nickhowes@xxxxxxxxxxxxxxxx> wrote:



> On 9/13/05, Christian Rick <rick@xxxxxxxxxx> wrote:
>>
> in the meanwhile, right now i'm try to improve the key used in the game.
> but
> have a problem with it. what i want to do is, i press the ESC to pause
the
> game and then if i want to quit i press ESC button once more.
>
> But right now, what happen is when i press ESC to pause directly quit
the
> game :(


Perhaps you are checking the keystate when you should be checking just for
keydown? Checking the keystate is useful when you want to control the
player, as it will stay on for as long as you hold the key. But if you're
doing this to check ESC it might be registering it twice in one press, in
which case you should just do it on keydown; the onKeyPressed() or
somesuch method in Java. You may be doing this already and it may be a
different problem, but just in case :)


Nick H



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html






Send instant messages to your online friends http:// au.messenger.yahoo.com

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html






--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: