Advertisement

key processing?

Started by January 09, 2002 10:29 PM
0 comments, last by cdhart 23 years, 1 month ago
Ok im confused here, i looked it up on the MSN library and for the bool process keys for a letter on the keyboard say "S" you would have [VK_S]. like its done in lesson 31. except it uses the arrows and i want to use those for camera movement and the letters for character movement so i need to figure out why it wont seem to compile. int ProcessKeys() { if (keys[VK_W]) { TVector newveloc(0,-5,0); ArrayVel[10] = newveloc + veloc; } if (keys[VK_S]) { TVector newveloc(0,5,0); ArrayVel[10] = newveloc + veloc; } if (keys[VK_A]) { TVector newveloc(-5,0,0); ArrayVel[10] = newveloc + veloc; } if (keys[VK_D]) { TVector newveloc(5,0,0); ArrayVel[10] = newveloc + veloc; } if (keys[VK_UP]) pos+=TVector(0,0,-10); if (keys[VK_UP]) pos+=TVector(0,0,10); if (keys[VK_LEFT]) camera_rotation+=10; if (keys[VK_RIGHT]) camera_rotation-=10; if (keys[VK_ADD]) i only recieve erros for the W,S,A, and D but the rest are fine. Are these really the correct things or do i need to add something or what? thanks
I had the same error. All you have to do is replace the letters with their ASCII characters, eg. VK_S becomes ''S''.
"No break 'till you die!" - Mr. Foster, my English teacher

This topic is closed to new replies.

Advertisement