Ignore:
Timestamp:
May 2, 2012, 2:02:07 PM (9 years ago)
Author:
sam
Message:

orbital: put the tanks in a separate class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/orbital.cpp

    r1332 r1333  
    2424
    2525#include "orbital.h"
    26 #include "mesh.h"
    27 #include "particlesystem.h"
    28 #include "camera.h"
    2926
    3027Orbital::Orbital()
     
    6360    m.SendCommand("rx20,ry30,t0,40,-20,fl");
    6461
    65     /* Tank body + tank head */
    66     m.SendCommand("sc0.1,0.1,0,1,ab6,6,15,ty-2,sc1,1,1,1,afcb4,5,16,0.4,tx4,tx60,mx,tx120,fl,sc0.2,0.7,0,1,afcb8,7,10,0.4,tz-4,tx60,fl");
    67     m.SendCommand("sc0.2,0.7,0,1,afcb3,6,10,0.4,tx-8,afcb3,6,10,0.4,tx4,ty10,tx60,fl,sc1,1,1,1,afcb3,6,10,0.4,rx-30,ty10,tx60,fl");
    68 
    6962    /* Orange player ship */
    7063    m.SendCommand("sc1,.5,0,1");
     
    8881
    8982    m_particlesystem = new ParticleSystem();
     83    Ticker::Ref(m_particlesystem);
     84
    9085    m_camera = new Camera(vec3(0, 200, 300),
    9186                          vec3(0, 0, 0),
    9287                          vec3(0, 1, 0));
     88    Ticker::Ref(m_camera);
     89
     90    for (int i = 0; i < 4; i++)
     91    {
     92        m_tanks << new Tank();
     93        m_tanks.Last()->m_position = vec3(i * 40.f - 60.f, 0, i * 10.f + 20.f);
     94        Ticker::Ref(m_tanks.Last());
     95    }
    9396
    9497    m_auto_cam_timer = 0.0f;
     
    98101
    99102    m_ready = false;
    100 
    101     Ticker::Ref(m_particlesystem);
    102     Ticker::Ref(m_camera);
    103103}
    104104
     
    171171Orbital::~Orbital()
    172172{
     173    for (int i = 0; i < m_tanks.Count(); i++)
     174        Ticker::Unref(m_tanks[i]);
    173175    Ticker::Unref(m_particlesystem);
    174176    Ticker::Unref(m_camera);
Note: See TracChangeset for help on using the changeset viewer.