#include "Gravity.h"
+#include "../Entities/PhysicsEntity.h"
+
+/// ***** Private Variables *****
+
+float forceGravity = 0.001;
/// ***** Constructors/Destructors *****
/// ***** Public Class Methods *****
-Vector2 Gravity::forceDelta(const PhysicsEntity*, float) const
+Vector2 Gravity::forceDelta(const PhysicsEntity* e, float) const
{
- return Vector2(0, 0.001);
+ return Vector2(0, e->mass * forceGravity);
}
void creator::init()
{
Ball* ball;
+ float startMass = 5;
ball = addBall(Vector2(50, 50), 20, cWhite, startBalls);
- ball->mass = 10;
+ ball->mass = startMass;
ball = addBall(Vector2(150, 50), 20, cGrey, startBalls);
- ball->mass = 10;
+ ball->mass = startMass;
ball = addBall(Vector2(50, 100), 20, cRed, startBalls);
- ball->mass = 10;
+ ball->mass = startMass;
ball = addBall(Vector2(100, 100), 20, cGreen, startBalls);
- ball->mass = 10;
+ ball->mass = startMass;
ball = addBall(Vector2(150, 100), 20, cBlue, startBalls);
- ball->mass = 10;
+ ball->mass = startMass;
ball = addBall(Vector2(50, 150), 20, cYellow, startBalls);
- ball->mass = 10;
+ ball->mass = startMass;
ball = addBall(Vector2(100, 150), 20, cMagenta, startBalls);
- ball->mass = 10;
+ ball->mass = startMass;
ball = addBall(Vector2(150, 150), 20, cCyan, startBalls);
- ball->mass = 10;
+ ball->mass = startMass;
}
void creator::clean()
{