Re: [Tutor] Need help with python keyboard press/navigation commands
>> Finally, from a user experience point of view, it might be more logical to >> make the keys w,a,s,z North, West,East and South respectively > >Most games use WASD, so user experience would be in favour of it >compared to WASZ. There are a couple of reasons for this: > >You live and learn! :-) You can probably also deduce that I'm more of a touch typist than I am a gamer... or does solitaire count? Moving backwards (south) would be even worse. Finally, WASD has the >same layout as the arrow keys, Arrow keys? What are they? hjkl in vim and C-n,C-p,C-f,C-b in emacs Thanks for the education. Alan G___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Need help with python keyboard press/navigation commands
> Finally, from a user experience point of view, it might be more logical to > make the keys w,a,s,z North, West,East and South respectively since its a > more logical correspondence to the compass points (assuming a standard > QWERTY keyboard layout). Most games use WASD, so user experience would be in favour of it compared to WASZ. There are a couple of reasons for this: if you're moving forward you're not moving backward, and if you're moving backward you're not moving forward, so the finger you use for W can be used for S. So finger position is W(S) A and D; three fingers that can handle moving at an angle (NW, NE by keys WA or WD, SW and SE by keys SA or SD) or in one direction. Compare with WASZ, moving NW is still WA, but NE would be WS, which are keys that are very close together. Moving backwards (south) would be even worse. Finally, WASD has the same layout as the arrow keys, but is located elsewhere on the keyboard (so you can map other keys to other functions in the games; your pinky is close to both shift and ctrl, thumb to space and C, E, R, F, V and Q, and 1-5 are all within close range -- compare to the arrow keys, where you get four keys (shift, ctrl, 1 and 0) nearby). Some people like to use the number keys (8456 for WASD) instead, as they too are relatively close to more keys, but overall I think that WASD is the standard. At least that's what I suspect. -- best regards, Robert S. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Need help with python keyboard press/navigation commands
On 12/03/13 03:59, akuma ukpo wrote: I have tried def get_direction(self): """ whenever a key is pressed the character moves to the direction corresponding to the key """ 'North':w 'South': s 'East' : d 'West' : a What did you think that would do? There is no control structure and no return value. Nothing is assigned to anything. And none of the names are defined anywhere. It makes no sense to me looking at it and it certainly doesn't make sense to Python trying to execute it. If you want to respond to keys you are going to have to either pass in the keystroke to the function or read the keystroke inside the function. How you do that depends on whether you are using a GUI, and if so which. Whether you are using PyGame. Or if a CLI program which OS you are using. Finally, from a user experience point of view, it might be more logical to make the keys w,a,s,z North, West,East and South respectively since its a more logical correspondence to the compass points (assuming a standard QWERTY keyboard layout). -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Need help with python keyboard press/navigation commands
On Mon, Mar 11, 2013 at 8:59 PM, akuma ukpo wrote: > This is the problem > > Implement a function called get_direction which, on a particular character > , gives the > direction corresponding to that character. Do you know how to write a test case for this function? You had test cases for one of the previous problems you sent the list earlier. Can you do the same thing for this problem? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor