cassius Posted April 5, 2013 Share Posted April 5, 2013 There are many places in my game where the character could fall from a high place to what in real life would mean death or severe injury. Is there a way I can implement this whereever it occurs in the game in the same bit of code? I know how to impement it in specific places but there are too many places it could occur to make that method feasible. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
gamecreator Posted April 5, 2013 Share Posted April 5, 2013 I think this came up in another thread but I forget how it was resolved. The simplest may be just to check the Y velocity (I believe). If it's 0 (or close) and last frame it was a large negative, kill or injure the player accordingly. Quote Link to comment Share on other sites More sharing options...
Josh Posted April 5, 2013 Share Posted April 5, 2013 Check for a collision with a speed above a certain value? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Pancakes Posted April 5, 2013 Share Posted April 5, 2013 you could have a boolean that checks whether character is on the ground or not, whenever this character is not on the ground you can start a timer, if the character comes in contact with the ground after a certain amount of time you should subtract someHPvalue * amount of time airborne Quote Core I5 2.67 / 16GB RAM / GTX 670 Zbrush/ Blender / Photoshop CS6 / Renoise / Genetica / Leadwerks 3 Link to comment Share on other sites More sharing options...
cassius Posted April 5, 2013 Author Share Posted April 5, 2013 Thanks for replies. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
DarthRaff Posted April 6, 2013 Share Posted April 6, 2013 And don't forget to check if the player just falls down a slope. When he arribes at the ground he will dies or take the injury unnecessarily if it does not checked, i think Quote Link to comment Share on other sites More sharing options...
cassius Posted April 6, 2013 Author Share Posted April 6, 2013 Yeah there are all sorts of pitfalls to solving this prob.If you don;t think it out you can create other problems. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.