Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


majc

Member Since 17 Oct 2004
Offline Last Active Feb 01 2011 04:32 PM

Topics I've Started

Do you know where to start? See here!

27 January 2011 - 05:06 PM

Hi to all,

I'm doing a blog to help beginners in the game development.
Here it is:

http://howtomakeagameinmyopinion.blogspot.com/

I hope this helps some lost beginners like me some time ago.
Please give me your feedback to know if it helped and what info it's missing.
By the way I'm not english and my english is bad :P

Visual Basic 6 with Database

23 May 2006 - 03:04 PM

Im trying to read some values of some fields, make a multiplication and then add the result to a database. I tryed to do this: Private Sub cmdCalc_Click() Dim op1 As Single Dim op2 As Single op1 = Val(txtQuant.Txt) op2 = Val(txtUni.Txt) txtTotLiq = Op1 * Op2 End Sub But the problem is that when i try to write txtQuant. apears Count, Item, LBound and Ubound, dont apears .Txt Why??

initialize an array

11 August 2005 - 07:44 AM

How i initialize an array like this: sRoute Route[5] = { {400.0f,pLand->GetHeight(Enemy->sngPositionX, Enemy->sngPositionZ),100.0f}, {100.0f,pLand->GetHeight(Enemy->sngPositionX, Enemy->sngPositionZ),300.0f}, {300.0f,pLand->GetHeight(Enemy->sngPositionX, Enemy->sngPositionZ),200.0f}, {200.0f,pLand->GetHeight(Enemy->sngPositionX, Enemy->sngPositionZ),100.0f}, {0.0f,pLand->GetHeight(Enemy->sngPositionX, Enemy->sngPositionZ),400.0f} }; Thanks in advance!!

jump forward

19 May 2005 - 06:33 AM

Until now i only get my cam jump upwards i need to jump forward but i dont know how can i do that. This is my jump code: a= 10; if(pInput->IsKeyPressed(TV_KEY_SPACE)) // jump code { sngVelocityY = 100; Jumping = true; } if(Jumping == true) { if(sngVelocityY > -1000) { sngVelocityY = sngVelocityY - a; sngPositionY = sngPositionY + sngVelocityY; } } HeightLand = pLand->GetHeight(sngPositionX, sngPositionZ) + fCamHeight; if(sngPositionY <= HeightLand) { sngPositionY = HeightLand; sngVelocityY = 0; Jumping = false; }

Need help with jump input keys

18 May 2005 - 06:12 AM

I need help with jump physics this is my code: void input() { //Check if we pressed the UP arrow key, if so, then we are //walking forward. if(pInput->IsKeyPressed(TV_KEY_UP)) sngWalk = 1; //If we are not walking forward, maybe we are walking backward //by using the DOWN arrow? If so, set walk speed to negative. if(pInput->IsKeyPressed(TV_KEY_DOWN)) sngWalk = -1; //Check if we pressed the LEFT arrow key, if so, then strafe //on the left. if(pInput->IsKeyPressed(TV_KEY_LEFT)) sngStrafe = 1; //If we are not strafing left, maybe we want to strafe to the //right, using the RIGHT arrow? If so, set strafe to negative. if(pInput->IsKeyPressed(TV_KEY_RIGHT)) sngStrafe = -1; /*if(sngPositionY <= HeightLand) { v=0; }*/ /*if(sngPositionY <= HeightLand) { sngPositionY=HeightLand; }*/ if(pInput->IsKeyPressed(TV_KEY_C) == tvfalse)// Crouch code { sngPositionY = 150; } if(pInput->IsKeyPressed(TV_KEY_C)) { HeightLand = pLand->GetHeight(sngPositionX, sngPositionZ); sngPositionY = sngPositionY - 5; if(sngPositionY <= HeightLand) { sngPositionY=HeightLand; } } //-----------physics------------------ a= 9.8f; v= v + a; sngPositionY= sngPositionY + v; //-------------------------------------- if(pInput->IsKeyPressed(TV_KEY_SPACE)) // jump code { sngPositionY = sngPositionY + 150; } /*if(pInput->IsKeyPressed(TV_KEY_M)) { m = 2; } if(pInput->IsKeyPressed(TV_KEY_M) == tvfalse) { m = 1; }*/ //Now, for the mouse input... long tmpMouseX = 0; long tmpMouseY = 0; long tmpMouseB1 = 0; long tmpMouseB2 = 0; long tmpMouseB3 = 0; long tmpMouseScrollOld = 0; long tmpMouseScrollNew = 0; //We pass the actual value of the mouse scroller to the variable //that holds the old mouse scroller value. tmpMouseScrollOld = tmpMouseScrollNew; //By using GetMouseState, we get the movement of the mouse //with the speed of the movement. The fastest the mouse movement //will be, the higher will be the return. pInput->GetMouseState(&tmpMouseX, &tmpMouseY, (short *)&tmpMouseB1, (short *)&tmpMouseB2, (short *)&tmpMouseB3, &tmpMouseScrollNew); //From the mouse return values, we update the camera angles //by adding or substracting the mouse return value. sngAngleX = sngAngleX - ((float)tmpMouseY / 100.0f); sngAngleY = sngAngleY - ((float)tmpMouseX / 100.0f); //We will add a simple check, so we can't look up at more //than 80 degrees nor down than -80 degrees. if(sngAngleX > 1.3f) sngAngleX = 1.3f; if(sngAngleX < -1.3f) sngAngleX = -1.3f; //Okay, now for the smothing of the movement... We checked //above if we were pressing a key. If so, then we updated the //movement variable to 1 (positive or negative). Here, we //lower this value until it get to 0. This method give us a //smoother camera movement. We start by updating the forward //and backward (walk) movement. if(sngWalk > 0) { sngWalk = sngWalk - 0.05f; if(sngWalk < 0) sngWalk = 0; } if(sngWalk < 0) { sngWalk = sngWalk + 0.05f; if(sngWalk > 0) sngWalk = 0; } //Now, we update the left and right (strafe) movement. if(sngStrafe > 0) { sngStrafe = sngStrafe - 0.05f; if(sngStrafe < 0) sngStrafe = 0; } if(sngStrafe < 0) { sngStrafe = sngStrafe + 0.05f; if(sngStrafe > 0) sngStrafe = 0; } fTimeElapsed = pEngine->TimeElapsed(); //Update the vectors using the angles and positions. sngPositionX = sngPositionX + (cosf(sngAngleY) * sngWalk / 5 * fTimeElapsed) + (cosf(sngAngleY + 3.141596f / 2.0f) * sngStrafe * fTimeElapsed); //sngPositionY = sngPositionY + (tanf(sngAngleY) * sngWalk / 5 * fTimeElapsed) + (tanf(sngAngleY + 3.141596f / 2.0f) * sngStrafe * fTimeElapsed); sngPositionZ = sngPositionZ + (sinf(sngAngleY) * sngWalk / 5 * fTimeElapsed) + (sinf(sngAngleY + 3.141596f / 2.0f) * sngStrafe * fTimeElapsed); sngLookAtX = sngPositionX + cosf(sngAngleY); sngLookAtY = sngPositionY + tanf(sngAngleX); sngLookAtZ = sngPositionZ + sinf(sngAngleY); //New : because we are using a landscape with up and down, we //can't let the camera at the same height. We want the camera to //follow the height of the map, so we use the "get height". Also, //because we want to have the effect that we are not a mouse, //we will add some height to the height returned... //With the new values of the camera vectors (position and //look at), we update the scene's camera. pScene->SetCamera(sngPositionX, sngPositionY+100.0f, sngPositionZ, sngLookAtX, sngLookAtY+100.0f, sngLookAtZ); if(pInput->IsKeyPressed(TV_KEY_ESCAPE)) //Check if ESCAPE has been pressed. { PostQuitMessage(0); } }

PARTNERS