Question
A very long world Let's change the game so it's a long world that you're moving through. Instead of the enemies coming at you, you
A very long world
Let's change the game so it's a long world that you're moving through. Instead of the enemies coming at you, you are flying through them.
To do this, go to the cGameDefender3D constructor and change the third argument to the call _border.set(19, 19.0, 41.0); put in something big like 400. Then comment out the line in the cCritterDefender3DPlayer constructor that begins setMoveBox. Instead we'll be letting the player have its default movebox be the same as the _border.
If you run this version, you'll see that the prop critters are too far away. What we can do about this is to change the cCritterDefender3DProp constructor to position the new props at a random location ahead but not too far away at a distance of, say, 3040 units down the z-axis from the player()->position(). This means plugging in new locorner and hicorner arguments for the randomizePosition call based on player()->position().
Another good change here would be to have the props die as soon as they are behind the player, rather than waiting for the BOX_HIZ flag to appear in a prop critter's _outcode.
It would also make more sense not to penalize the player when a prop gets by. Instead just penalize the player when a prop or a bullet hits the player. This move of course makes it too easy for the player, so we'd better put in some cCritterDefender3DProp critters to shoot at the player.
You might also want to put some kind of furniture on the 'floor' of the world, some fixed critters by which you can judge your motion. In addition, you could have the appearance of the sprite and rival critters change as you move further into the world.
Yet another change to consider would be to use some variation on cListenerCar or cListenerSpaceship so that you can 'drive' your player in a somewhat realistic fashion, with gravity having an effect upon it.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started