CMPS-3350 Software Engineering
Lab-6
1. Start with your lab-1 or lab-2 program. Save it as 3350/6/waterlab6.cpp 2. Also copy your Makefile and keep it updated. 3. Follow along on the big-screen... Add some features to the waterlab6.cpp program · A box C++ class · A particle C++ class · Draw the box and a particle above the box · Define the velocity of objects · Define the physics of gravity · Apply gravity to the particle · Make an array of particles (a particle system) · Create a particle on mouse click · Detect and resolve collision of particle and box · Particle stopped by box as if a particle of water · Delete a particle that goes off screen Ask for help if you miss something as we go.
Continue working on your waterlab6.cpp 1. Draw 5 boxes 2. Align them like the Waterfall Model that we have learned. 3. Make your mouse drop many particles to look like a stream of water. 4. The particles will flow down your Waterfall. Hints: Make an array of 5 box classes. Set the top box into position, and the rest are offsets from that. For each particle, check for collision with all of the boxes. Your goal will be something like this...
Look ----+ | VHere are Waterfall models from previous students... Alex (2016)For homework... I will build your final program like this: g++ mylab6.cpp -Wall -lX11 -lGL -lGLU -lm libggfonts.a Please do not make your own #include files for now. You may bring these files into your folder and use them: → fonts.h → libggfonts.a → image.png → image.jpg The name of your program is: waterlab6.cpp -------------Andrew (2019)
SarahBeth (2015)
![]()