Changeset 1333


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

orbital: put the tanks in a separate class.

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/Makefile.am

    r1307 r1333  
    33
    44orbital_SOURCES = \
    5     orbital.cpp orbital.h mesh.h particlesystem.h
     5    orbital.cpp orbital.h mesh.h particlesystem.h tank.h
    66orbital_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@
    77orbital_LDADD =
  • 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);
  • trunk/orbital/orbital.h

    r1332 r1333  
    1010#include "mesh.h"
    1111#include "particlesystem.h"
    12 #include "camera.h"
     12#include "tank.h"
    1313
    1414class Orbital : public WorldEntity
     
    3232    ParticleSystem *m_particlesystem;
    3333    Camera *m_camera;
     34    Array<Tank *> m_tanks;
    3435
    3536    bool m_ready;
  • trunk/orbital/particlesystem.h

    r1332 r1333  
    2828    }
    2929
    30     char const *GetName() { return "<particlesystme>"; }
     30    char const *GetName() { return "<particlesystem>"; }
    3131
    3232protected:
  • trunk/win32/orbital.vcxproj

    r1327 r1333  
    3232    <ClInclude Include="..\orbital\orbital.h" />
    3333    <ClInclude Include="..\orbital\particlesystem.h" />
     34    <ClInclude Include="..\orbital\tank.h" />
    3435  </ItemGroup>
    3536  <ItemGroup>
  • trunk/win32/orbital.vcxproj.filters

    r1327 r1333  
    44    <ClInclude Include="..\orbital\mesh.h" />
    55    <ClInclude Include="..\orbital\CommandParser.h" />
     6    <ClInclude Include="..\orbital\tank.h" />
    67  </ItemGroup>
    78  <ItemGroup>
Note: See TracChangeset for help on using the changeset viewer.