This topic is now archived and is closed to further replies.


key processing?

Recommended Posts

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

Share this post

Link to post
Share on other sites