football94

Member

64

211 Neutral

• Rank
Member
1. Double jump 3d

Problem solved I had much help from the link below http://xboxforums.create.msdn.com/forums/t/113607.aspx         modified code bool doubleJump; //logs whether the player has done a double jump yet void DudeGravity2(GameTime gameTime) { float treshold = 0.0f; float terrainHeight = GetExactHeightAt(avatarPosition2.X, -avatarPosition2.Z); if (avatarPosition2.Y < terrainHeight + treshold) { newPos = avatarPosition2; newPos.Y = terrainHeight + treshold * (float)gameTime.ElapsedGameTime.TotalSeconds; avatarPosition2 = newPos; gravityVelocity = 0;// On ground so not falling. //jump if (keyState.IsKeyDown(Keys.L)) { doubleJump = false; gravityVelocity = 1f; // Adjust this value to control height of jump. } } else { // Not on ground so must be falling. //Add in effect of gravity on current velocity. // m/sec^2 float g = -1.10f; gravityVelocity += g * (float)gameTime.ElapsedGameTime.TotalSeconds; //Add effect of velocity to position. newPos = avatarPosition2; newPos.Y += gravityVelocity * (float)gameTime.ElapsedGameTime.TotalSeconds; avatarPosition2 = newPos; //jump if (!doubleJump && keyState.IsKeyDown(Keys.L)) { doubleJump = true; gravityVelocity = 1f; // Adjust this value to control height of jump. } } another way of doing the same thing separate from the dudegavity2 method KeyboardState oldState; KeyboardState newState = Keyboard.GetState(); // get the newest state if (newPos.Y <= 1f) { //jump if (oldState.IsKeyUp(Keys.R) && newState.IsKeyDown(Keys.R)) { doubleJump = false; gravityVelocity = 1f; // Adjust this value to control height of jump. } else { //jump if (!doubleJump && keyState.IsKeyDown(Keys.R)) { doubleJump = true; gravityVelocity = 1f; } } oldState = newState; }
2. Double jump 3d

Thanks for the response Norm but I have one more question, is there a way to apply this technique while in mid air like in such games as mario 64( I provided sample examples below)                                                                      Thanks again :)       (Mario does a mid air double jump at about 21 seconds into the video)       here's a 2d version of the midair double jump       here's a 2d jpeg illustration. The character does a mid air jump avoiding the water [attachment=31758:IMG_1356.jpg]

4. Terrain scaling

Hi guys    Ive been experimenting with a terrain from riemers xna tutorial website( link below) and came across a problem with scaling the terrain, in my draw method(code below) I added Matrix.CreateScale and the terrain looks to be scaled but when begin to move across the terrain I get an out of bounds exception and I think the problem is even though the terrain is scaled visually  it still seems to reading the boundary data from the original size of the terrain,so I was hoping if anyone had any tips on how to help me solve the problem.                         Thank you private void DrawCity(string technique) { effect1.CurrentTechnique = effect1.Techniques[technique]; effect1.Parameters["xTexture"].SetValue(sceneryTexture); effect1.Parameters["xWorld"].SetValue(Matrix.Identity ); effect1.Parameters["xLightPower"].SetValue(lightPower); effect1.Parameters["xWorldViewProjection"].SetValue(Matrix.Identity *Matrix.CreateScale(10) * view * proj * Matrix.CreateTranslation(0,0,0)); effect1.Parameters["xLightPosition"].SetValue(position ); effect1.Parameters["xAmbient"].SetValue(ambientPower); effect1.Parameters["xlightsWorld"].SetValue(Matrix.Identity * lightsViewProjectionMatrix); effect1.Parameters["xShadowMap"].SetValue(shadowMap); effect1.Begin(); foreach (EffectPass pass in effect1.CurrentTechnique.Passes) { pass.Begin(); device.VertexDeclaration = new VertexDeclaration(device, VertexPositionNormalTexture.VertexElements); device.Vertices[0].SetSource(cityVertexBuffer, 0, VertexPositionNormalTexture.SizeInBytes); device.DrawPrimitives(PrimitiveType.TriangleList, 0, cityVertexBuffer.SizeInBytes / 3); pass.End(); } effect1.End(); riemers link http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2/Loading_the_floorplan.php
5. uneven 3D tile map

Thanks for the reply HappyCoder but Ive managed to come up with a solution which was to just change the int floorplan into a float floorplan which works perfectly for me since that I now have more options to play around with the number values     Thankyou   new code below public void LoadFloorPlan() { floorPlan = new float[,] { {0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f}, {0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f}, {0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f}, {0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f}, {0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f}, {0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f,0.1f}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}, {0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f}, {0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f}, {0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f}, {0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f}, {0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f}, {0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f}, {0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f}, {0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f}, {0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f}, {0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f}, {0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f,0.002f}, }; }

7. Cloning a 3D Model

Thankyou imoogiBG I never thought of that, thanks for teaching me something new.                                                       Thanks again
8. Cloning a 3D Model

Hi guys Ive been researching the sub zero ice clone technique(pic below) in the mortal kombat games and been trying to figure out how I can implement this techique in xna but Im not quite sure how its done and was hoping if anyone would be so kind as to give any pointers or comments on the subject.                                                                                Thankyou       Resources Ive researched so far but still not sure http://xbox.create.msdn.com/en-US/education/catalog/sample/mesh_instancing http://xboxforums.create.msdn.com/forums/p/26056/142855.aspx           Subzero clone pic   [attachment=28614:subzero clone.png]       Subzero clone video from youtube           I think a simpler example of what Im looking for is in the youtube video below when the ball starts to repeat about 35 seconds into the video