Changeset 1344


Ignore:
Timestamp:
May 6, 2012, 2:23:24 PM (9 years ago)
Author:
sam
Message:

orbital: create a Player class with joystick support.

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/Makefile.am

    r1333 r1344  
    33
    44orbital_SOURCES = \
    5     orbital.cpp orbital.h mesh.h particlesystem.h tank.h
     5    orbital.cpp orbital.h mesh.h particlesystem.h tank.h player.h
    66orbital_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@
    77orbital_LDADD =
  • trunk/orbital/orbital.cpp

    r1340 r1344  
    6060    m.SendCommand("rx20,ry30,t0,40,-20,fl");
    6161
    62     /* Orange player ship */
    63     m.SendCommand("sc1,.5,0,1");
    64     m.SendCommand("afcb5,1,3,0.6,fl,sc1,1,1,1,afcb1,5,3,0.6,tz-1,irb");
    65     m.SendCommand("sc1,.5,0,1");
    66     m.SendCommand("afcb3,6,7,.4,t0,0,7,sc1,1,1,1,afcb3,4,4,.4,t4,0,-4,mx,fl");
    67     m.SendCommand("sc1,.5,0,1");
    68     m.SendCommand("afcb3,6,5,.4,sc1,1,1,1,afcb2,3,9,.4,fl");
    69     m.SendCommand("scb1,1,1,1,ac4,15,.2,.6,1,1,tz-2,ac4,15,.2,.6,1,1,rx90,t0,-2,-7,fl");
    70 
    7162    /* Orange fire */
    7263    m.SendCommand("sc1,1,0,1,scb1,0,0,0,at4,1,s1.5,1,4,tz-13,ad6,5.8,1");
     
    7566    /* Lasers */
    7667    m.SendCommand("sc1,1,1,1,scb0,0,0,1,aq8,1,sx0.25,tx-3,sc1,0,0,1,scb0,0,0,1,aq8,1,tx4,sz50,sx0.3,tz-200,mx,as10,12,8,1,1,ty60,fl");
    77 
    78     /* Thrusters */
    79     m.SendCommand("sc0,1,1,scb0,0,0,1,ac5,15,0,1.5,0,1,ac7,35,1.1,4,0,1,rx90,t-3,0,27,mx");
    80     m.SendCommand("fl");
    8168
    8269    //m_particlesystem = new ParticleSystem();
     
    8875    Ticker::Ref(m_camera);
    8976
     77    /* Add tanks */
    9078    for (int j = 0; j < 10; j++)
    9179    for (int i = 0; i < 10; i++)
     
    9583        m_tanks.Last()->SetTarget(vec3(i * 80.f - 200.f, 0, j * 80.f - 130.f));
    9684        Ticker::Ref(m_tanks.Last());
     85    }
     86
     87    /* Add player */
     88    for (int i = 0; i < 1; i++)
     89    {
     90        m_players << new Player();
     91        Ticker::Ref(m_players.Last());
    9792    }
    9893
     
    177172    for (int i = 0; i < m_tanks.Count(); i++)
    178173        Ticker::Unref(m_tanks[i]);
     174    for (int i = 0; i < m_players.Count(); i++)
     175        Ticker::Unref(m_players[i]);
    179176    //Ticker::Unref(m_particlesystem);
    180177    Ticker::Unref(m_camera);
  • trunk/orbital/orbital.h

    r1333 r1344  
    1111#include "particlesystem.h"
    1212#include "tank.h"
     13#include "player.h"
    1314
    1415class Orbital : public WorldEntity
     
    3233    ParticleSystem *m_particlesystem;
    3334    Camera *m_camera;
     35    Array<Player *> m_players;
    3436    Array<Tank *> m_tanks;
    3537
  • trunk/win32/orbital.vcxproj

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

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