Hello Blender GE forum! I am starting on my first legitimate game in the Blender GE. My first one had no goals to speak of except pushing boxes around. I am making a 3D clone of the popular lunar lander game.
- What I want is a camera that rotates around the lander via the mouse, but since the lander is moving it needs to be following the lander too (can I do that by simply parenting the camera to the lander?). Also the camera shouldn’t go below the ground, is there any way to make that so?
- I want a starry sky, and I have already created a skybox. However when the lander moves around it is sort of obvious that the skybox is close (it just has a fake look). Should I make the skybox bigger, or parent the skybox to the lander so it moves with the lander, or is there a better way?
- Is there any way w/ Python or w/o to calculate the force of a collision (in a “speed per time” fashion, or in joules etc)? Because I need the user to fail if they smash into the ground with too much energy.
- I know how to check if an actor is touching something, but how do I check if my actor is not touching something. I want the lander to be able to rotate only if it is not touching the ground. Python, logic blocks, how?
Thanks in advance for any help!
Sorry, but am I asking complex questions here or what?
To make a third-person view “mouselook” behavior, you need to use an Empty as a center point for the camera to rotate around. Make the Empty the parent of the Camera, then make the lander thevertex parent of the Empty. You will then need to give the Empty a mouselook script. (If you want both left/right and up/down rotations, then you will need two empties.)
You will want to vertex parent your sky an object that you always want it to remain the same distance from. You can only vertex parent objects to a mesh, so if you want to vertex parent the sky to your Camera, do this:
- Add a plane and move it to the camera’s location.
- Make the camera to the parent of the plane.
- Vertex parent the sky to the plane.
Edit: I almost forgot that you also didn’t want the camera to go through the ground. This tutorial can show you how to do that: http://www.blending-online.co.uk/8501/49279.html
- You can’t do that without Python, but with Python you can get the velocity at which the lander is falling. You don’t really need to know how hard the lander crashed, just how fast it was going right before it crashed. You want to know the global velocity along the Z axis, which you can get by attaching this script to the lander:
cont = GameLogic.getCurrentController()
own = cont.getOwner()
globalVelocity = own.getLinearVelocity(0) #<i> get the global velocity</i>
fallingSpeed = globalVelocity # <i>get the Z axis value, which is "2"</i>
You still will need to do something with that value, though.
- Use the “INV” button on the Touch sensor to make it a “Not Touching” sensor.