- ObjectManager stuff
authorRyan Flegel <rflegel@gmail.com>
Tue, 18 May 2004 19:17:33 +0000 (19:17 +0000)
committerRyan Flegel <rflegel@gmail.com>
Tue, 18 May 2004 19:17:33 +0000 (19:17 +0000)
SVN-Revision: 1260

src/gameobjs.cpp
src/gameobjs.h

index 10b87c3..bb212aa 100644 (file)
@@ -479,5 +479,69 @@ void ObjectManager::load_badguys(std::string filename)
 */
 }
 
+void ObjectManager::draw_bg()
+{
+/*
+  for (unsigned int i = 0; i < bouncy_bricks.size(); ++i)
+    bouncy_bricks[i]->draw();
+
+  for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i)
+    (*i)->draw();
+
+  for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i)
+    (*i)->draw();
+*/
+}
+
+void ObjectManager::draw_fg()
+{
+/*
+  for (unsigned int i = 0; i < bullets.size(); ++i)
+    bullets[i].draw();
+
+  for (unsigned int i = 0; i < floating_scores.size(); ++i)
+    floating_scores[i]->draw();
+
+  for (unsigned int i = 0; i < upgrades.size(); ++i)
+    upgrades[i].draw();
+
+  for (unsigned int i = 0; i < bouncy_distros.size(); ++i)
+    bouncy_distros[i]->draw();
+
+  for (unsigned int i = 0; i < broken_bricks.size(); ++i)
+    broken_bricks[i]->draw();
+*/
+}
+
+void ObjectManager::actions()
+{
+/*
+  for (unsigned int i = 0; i < bouncy_distros.size(); i++)
+    bouncy_distros[i]->action(frame_ratio);
+
+  for (unsigned int i = 0; i < broken_bricks.size(); i++)
+    broken_bricks[i]->action(frame_ratio);
+
+  // Handle all kinds of game objects
+  for (unsigned int i = 0; i < bouncy_bricks.size(); i++)
+    bouncy_bricks[i]->action(frame_ratio);
+  
+  for (unsigned int i = 0; i < floating_scores.size(); i++)
+    floating_scores[i]->action(frame_ratio);
+
+  for (unsigned int i = 0; i < bullets.size(); ++i)
+    bullets[i].action(frame_ratio);
+  
+  for (unsigned int i = 0; i < upgrades.size(); i++)
+    upgrades[i].action(frame_ratio);
+
+  for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i)
+    (*i)->action(frame_ratio);
+
+  for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i)
+     (*i)->action(frame_ratio);
+*/
+}
+
 /* EOF */
 
index af9e5c2..b6cec55 100644 (file)
@@ -152,10 +152,10 @@ class ObjectManager
   // XXX Objects will have to be split up into two categories:
   //  - Drawn before tux
   //  - Drawn after tux
+  // Eventually Player should be a part of ObjectManager
 
   std::vector<BadGuy*> badguys;
   std::vector<Trampoline> trampolines;
-  //std::vector<ParticleSystem> particle_systems;
   std::vector<BouncyDistro> bouncy_distros;
   std::vector<BrokenBrick> broken_bricks;
   std::vector<BouncyBrick> bouncy_bricks;
@@ -167,6 +167,10 @@ class ObjectManager
  public:
   static ObjectManager* instance() { return instance_ ? instance_ : instance_ = new ObjectManager(); }
   static void destroy_instance() { delete instance_; instance_ = 0; }
+
+  void draw_bg();
+  void draw_fg();
+  void actions();
   
 /*  Object* get(unsigned int id) {
     if(id < badguys.size())