Welcome to the forum

register! and help us get started! with this new darkgdk forum !


dont forget to introduce yourself Razz

enjoy! and good luck with your programming Smile


Movement (Simplified)

Go down

Movement (Simplified)

Post  F4SHADO on Mon May 10, 2010 6:06 pm

Okay. Do you know how when in an fps you look straight up, the character can continuously move forward?? Well, I'm faced with that problem. When I look up, my character just moves, well, up. Here is my code...so far

"Controls.h" header file

Code:
//Mouse Look Variables
float OldCamAngleY;
float OldCamAngleX;
float CameraAngleY;
float CameraAngleX;

//Keyboard Movement Variables
#define w 17
#define s 31
#define a 30
#define d 32

void mouseControl()
{
   OldCamAngleY = CameraAngleY;
   OldCamAngleX = CameraAngleX;
   
   CameraAngleY = dbWrapValue ( CameraAngleY + dbMouseMoveX ( ) * 0.4f );
   CameraAngleX = dbWrapValue ( CameraAngleX + dbMouseMoveY ( ) * 0.4f );
   
   if ( CameraAngleX > 80 && CameraAngleX <180 ) CameraAngleX = 80;
   if ( CameraAngleX < 270 && CameraAngleX > 180 ) CameraAngleX = 270;

   dbYRotateCamera ( dbCurveAngle ( CameraAngleY, OldCamAngleY, 1.5f ) );
   dbXRotateCamera ( dbCurveAngle ( CameraAngleX, OldCamAngleX, 1.5f ) );

}

void keyboardControl()
{
   if (dbKeyState(w)==1)
   {
      dbMoveCamera ( +10);
   }
   if (dbKeyState(s)==1)
   {
      dbMoveCamera ( -10);
   }
   if (dbKeyState(a)==1)
   {
      dbYRotateCamera (0,dbCameraAngleY (0) -90);
      dbMoveCamera (10);
      dbYRotateCamera (0,dbCameraAngleY (0) +90);
   }
   if (dbKeyState(d)==1)
   {
      dbYRotateCamera (0,dbCameraAngleY (0) +90);
      dbMoveCamera (10);
      dbYRotateCamera (0,dbCameraAngleY (0) -90);
   }
}

Thank you for any help.

Kampai cheers


Last edited by F4SHADO on Tue May 11, 2010 5:03 pm; edited 1 time in total

F4SHADO

Posts : 36
Join date : 2010-05-08
Location : Springfield, Illinois

View user profile https://www.youtube.com/user/F4SHADO

Back to top Go down

Re: Movement (Simplified)

Post  Instinct949 on Tue May 11, 2010 4:09 pm

how are u going to be able to create this multiplayer fps ?


you been needing alot of help

just saying Smile


sorry i cant help you im just learning
avatar
Instinct949
Admin

Posts : 21
Join date : 2010-05-05
Age : 23

View user profile

Back to top Go down

Re: Movement (Simplified)

Post  F4SHADO on Tue May 11, 2010 5:02 pm

like i said, i have been learning for the last 6 months. i can pretty much figure out everything else on my own. movement is the thing that gets me the most.

btw, excuse that last post, seems i figured it out. Razz

mabe i should start waiting a little longer before i post for help Razz

EDIT: i'll post the code sometime later for all to see
sorry for any troubles i may have caused you

Kampai cheers

F4SHADO

Posts : 36
Join date : 2010-05-08
Location : Springfield, Illinois

View user profile https://www.youtube.com/user/F4SHADO

Back to top Go down

Re: Movement (Simplified)

Post  Instinct949 on Tue May 11, 2010 5:48 pm

no problem man but yea mayb try figure it out but if not ask then or if u just really dont no how to do it lol go ahead


btw i wasnt having ago at you Smile


good luck mate !
avatar
Instinct949
Admin

Posts : 21
Join date : 2010-05-05
Age : 23

View user profile

Back to top Go down

Re: Movement (Simplified)

Post  pqowieuryt101 on Tue May 11, 2010 5:57 pm

I don't mind answering any questions Razz

I think when you find a problem you should try figure it out by yourself for a bit, if your still stuck then ask for help here and I'll try and point you in the right direction.
avatar
pqowieuryt101
Admin

Posts : 97
Join date : 2010-04-22

View user profile http://darkgdk.forumotion.com

Back to top Go down

Re: Movement (Simplified)

Post  F4SHADO on Tue May 11, 2010 8:52 pm

Instinct949 wrote:no problem man but yea mayb try figure it out but if not ask then or if u just really dont no how to do it lol go ahead


btw i wasnt having ago at you Smile


good luck mate !

no problem guys, its all good. sometimes i can get a little....edgy. but yeah, i do try to figure them out on my own. i'll just wait longer before i decide to ask for help.

Kampai cheers

F4SHADO

Posts : 36
Join date : 2010-05-08
Location : Springfield, Illinois

View user profile https://www.youtube.com/user/F4SHADO

Back to top Go down

Re: Movement (Simplified)

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum