1212/* *< The maximum number of cannonballs allowed. This is because the cannonballs
1313 are stored in an array; but later versions might allow dynamically allocated number.*/
1414
15- #define DEFINED_USE_R2_VEL_MODDER
15+ // j #define DEFINED_USE_R2_VEL_MODDER
1616/* *< If this is defined, then program will use unrealistic method that will
1717 increase the velocity of two colliding balls the closer they are together
1818 it will reduce the number of times that the balls stick together,
@@ -31,13 +31,13 @@ namespace Cannonballs {
3131/* ****************************************************************************/
3232/* * The method of the collision (I just wanted to play around with some options.) */
3333enum Collisions {
34- CollideElastic = 0 , /* *< This is normal collision in a perfect would without
35- friction, they hit and bounce off, no energy is lost */
34+ CollideElastic = 0 , /* *< This is normal collision in a perfect world without
35+ friction, they hit and bounce off, no energy is lost. */
3636 CollideInelastic, /* *< This is the normal way things collide, Balls collide and
3737 bounce off of each other losing some energy. */
3838 CollidePerfectInelastic, /* *< In this method the balls collide and then
39- stick together */
40- CollideNone /* *< No collisions */
39+ stick together. */
40+ CollideNone /* *< No collisions, balls pass through each other. */
4141};
4242/* ****************************************************************************/
4343namespace Global {
@@ -94,13 +94,15 @@ namespace Global {
9494} // end namespace Global
9595/* ****************************************************************************/
9696int main (int argc, char *argv[]) {
97- /* * @brief The main function
98- *
99- * @param argc = Something required by SDL
100- * @param argv = Something required by SDL
101- * @return 0 for successfully ran, or 1 for an error happened.
102- *
103- */
97+ // ///////////////////////////////////////////////
98+ // / @brief The main function
99+ // /
100+ // / @param argc = Something required by SDL
101+ // / @param argv = Something required by SDL
102+ // / @return 0 for successfully ran, or 1 for an error happened.
103+ // /
104+ // ///////////////////////////////////////////////
105+
104106
105107 Global::Config.Check (); // Load Config file and all its values.
106108 if (Global::Config.values .blnLogging ) { // Open log file to clear it, if it exists
@@ -185,15 +187,16 @@ int main(int argc, char *argv[]) {
185187}
186188/* ****************************************************************************/
187189void Cannonballs::addNew (LOC mouseC, LOC mouseO, double HoldTime ) {
188- /* * @brief Will add a new cannonball based on the mouse start and mouse end.
189- * Mass of the ball will vary based on Hold Time
190- *
191- * @param mouseC = Current Mouse Location in X and Y
192- * @param mouseO = Old (start of mouse click) Mouse Location in X and Y
193- * @param HoldTime = Time (in seconds) that the mouse button was held down for
194- * @return void
195- *
196- */
190+ // ///////////////////////////////////////////////
191+ // / @brief Will add a new cannonball based on the mouse start and mouse end.
192+ // / Mass of the ball will vary based on Hold Time
193+ // /
194+ // / @param mouseC = Current Mouse Location in X and Y
195+ // / @param mouseO = Old (start of mouse click) Mouse Location in X and Y
196+ // / @param HoldTime = Time (in seconds) that the mouse button was held down for
197+ // / @return void
198+ // /
199+ // ///////////////////////////////////////////////
197200
198201 // Get location, vel, and angle
199202 double fire_v;
@@ -204,7 +207,7 @@ void Cannonballs::addNew(LOC mouseC, LOC mouseO, double HoldTime ) {
204207 fire_v = -1 * sqrt ( pow (mouseC.x - mouseO.x , 2 ) + pow (mouseC.y - mouseO.y , 2 ) );
205208 fire_v /= (double ) Global::Equations::fVelocityScalar ;
206209
207- // if the mouse if pointing straight up or straight down make the angle 90
210+ // If the mouse if pointing straight up or straight down make the angle 90
208211 // Otherwise calculate the angle with atan.
209212 if (mouseC.x == mouseO.x ) {
210213 angle = (PI / 2.0 ) * ( (mouseC.y > mouseO.y ) ? -1.0 : 1.0 );
@@ -233,10 +236,10 @@ void Cannonballs::addNew(LOC mouseC, LOC mouseO, double HoldTime ) {
233236void Cannonballs::checkCollisons (uint j) {
234237
235238 // ///////////////////////////////////////////////
236- // / @brief Checks ball number j is colliding with another ball and then do collisions
239+ // / @brief Checks ball number j is colliding with another ball and then do collisions.
237240 // /
238- // / @param j = the number in the array that ball we are checking is
239- // / @return void (all changes if they are colliding is handled in this function)
241+ // / @param j = the number in the array that ball we are checking is.
242+ // / @return void (all changes if they are colliding is handled in this function).
240243 // /
241244 // ///////////////////////////////////////////////
242245
0 commit comments