Building a physics engine to get things moving
Create a new class called PhysicsEngine
and edit it to match the following code:
class PhysicsEngine { // This signature and much more will //change later in the project boolean update(long fps, ParticleSystem ps){ if(ps.mIsRunning){ ps.update(fps); } return false; } // Collision detection method will go here }
The PhysicsEngine
class only has one method for now – update
. By the end of the project, it will have another method for checking collisions. The signature of the update
method receives the frames per second and a ParticleSystem
instance. The code simply checks whether ParticleSystem...