Question
Turn off asteroidasteroid collisions in Spacewar Turn off the asteroid-to-asteroid collisions in the Spacewar game. To do this, override the cCritterAsteroid::collidesWith(cCritter *pcritterother) method. Youll need
Turn off asteroidasteroid collisions in Spacewar
Turn off the asteroid-to-asteroid collisions in the Spacewar game. To do this, override the cCritterAsteroid::collidesWith(cCritter *pcritterother) method. You'll need to prototype the method in gamespacewar.h and implement it in gamespacewar.cpp. The implementation code should have these two lines.
Does this make the game run faster? Compare speeds before and after, using the Game popup menu to change the number of critters. When you compare the speeds of builds always make sure that both are Debug builds or both are Release builds.
if(pcritterother-> IsKindOf (RUNTIME_CLASS (cCritterAsteroid))) return CCollider::DONTCOLLIDE; return cCritter: : collidesWith(pcritterother);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
To turn off asteroidtoasteroid collisions in the Spacewar game you need to override the collidesWith ...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