[AGDev-newbies] enter key question
Thomas Ward
tward1978 at earthlink.net
Thu Jun 15 04:23:51 BST 2006
Hi, Richard.
That is not exactly what I was trying to get at. Understand KEY_A,
KEY_B, etc is what we call in programming a virtual key asignment witch
points to the actual byte[] asignment of the key. All languages have
them. In C#.net for example Keys.A, Keys.B, etc is how you reference
those keys. In Java VK_A,VK_B, etc will do the same thing.
What I am trying to get at is how does your program get keyboard
commands from the keyboard and process them. You have to have some kind
of loop or an event which constantly monitors the state of your keyboard
for events.
In the old days in C for example people used a while loop that tracked
keyboard input which isn't very attractive.
When Microsoft Windows became popular many C++ programmers used the
Win32 API to capture Windows events such as the keyboard events to ask
Windows what the state of the keyboard is.
With the development of Java in the late 90's the vm gets the events
from Windows, but for the application developer he/she tracks the
keyboard dispatch thread which gets it's keyboard information from the
Java runtime which gets its info from Windows.
I hate to say this, but it sounds like your class is very low quality.
There is allot of advanced topics you guys haven't covered, and not
knowing your course structure I'm not really sure anyone who graduates
from that class will know much more when they graduate from it. There is
a diference in learning to program a game any old way that works, and
writing a game and doing it right.
Richard Bennett wrote:
> well Tom the key[KEY_ENTER] does the checking for the enter key and
> say I want to check for the press of the "a" key I would write this
> key[KEY_A] and it would then check for the A key. I think that is what
> you are asking. I hope it is anyways. I think I can figure out the
> menu thing, or at least I hope taht I can, because it would make the
> code probably easier to read in the long run. and would make the games
> easier to play for other people I think. Anyways let me know if this
> is what you was talking about. I apologize I don't know alot of
> technical terms when it comes to programming because we didn't get
> really into depth with direct x at school, or really in depth at all
> since we basically taught ourself the C++ stuff since our teacher was
> never there. So please forgive me for not understand things that you
> are talking about.
>
> BEAN
> _______________________________________________
> AGDev-newbies mailing list
> AGDev-newbies at lists.agdev.org
> http://lists.agdev.org/cgi-bin/mailman/listinfo/agdev-newbies
>
>
More information about the AGDev-newbies
mailing list