Changeset 1300 for trunk/mrpigeon


Ignore:
Timestamp:
Apr 26, 2012, 8:20:48 PM (8 years ago)
Author:
sam
Message:

core: prefix some member variables with m_ for clarity.

Location:
trunk/mrpigeon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/mrpigeon/blueenemy.cpp

    r1211 r1300  
    2929    enemy_casualblueattack = Tiler::Register("mrpigeon/gfx/enemy_CasualBLUE_walkAttack.png", ivec2(16,24), ivec2(0)); /* 6 frames */
    3030
    31     position = vec3(512, 81, 0);
    32     velocity = vec3(-0.15f, 0, 0);
     31    m_position = vec3(512, 81, 0);
     32    m_velocity = vec3(-0.15f, 0, 0);
    3333}
    3434
     
    4141    enemytime = fmod(deltams + enemytime, 700.0f);;
    4242
    43     position += velocity * deltams;
     43    m_position += m_velocity * deltams;
    4444}
    4545
     
    4949
    5050    /* + 48 because of vertical flip */
    51     Scene::GetDefault()->AddTile(position.x > 255 ? enemy_casualblue : enemy_casualblueattack, (int)(enemytime * 6 / 700.0f), position + vec3(48.0f, 0, 0), 0, vec2(-3.0f, 3.0f));
     51    Scene::GetDefault()->AddTile(m_position.x > 255 ? enemy_casualblue : enemy_casualblueattack, (int)(enemytime * 6 / 700.0f), m_position + vec3(48.0f, 0, 0), 0, vec2(-3.0f, 3.0f));
    5252}
    5353
  • trunk/mrpigeon/mrpigeon.cpp

    r1211 r1300  
    5050    deco_floorrails = Tiler::Register("mrpigeon/gfx/DECO_floorRails3x.png", ivec2(72,24), ivec2(0));
    5151
    52     position = vec3(0, 0, 0);
    53     bbox[0] = position;
    54     bbox[1] = vec3(512, 384, 0);
     52    m_position = vec3(0, 0, 0);
     53    m_bbox[0] = m_position;
     54    m_bbox[1] = vec3(512, 384, 0);
    5555    Input::TrackMouse(this);
    5656}
     
    9292    for (int i = 0; i < 10; i++)
    9393    {
    94         if (enemies[i] && enemies[i]->position.x < -100.0f)
     94        if (enemies[i] && enemies[i]->m_position.x < -100.0f)
    9595        {
    9696            Ticker::Unref(enemies[i]);
  • trunk/mrpigeon/player.cpp

    r1211 r1300  
    3333    active_set(NULL),
    3434    active_frame(0),
    35     velocity(0.0f),
    3635    walktime(0.0f),
    3736    flytime(0.0f)
     
    4948    player_walkraisefist = Tiler::Register("mrpigeon/gfx/player_WalkRaiseFist.png", ivec2(16,32), ivec2(0)); /* 8 frames */
    5049
    51     position = vec3(120.0f, 400.0f, 5.0f);
     50    m_position = vec3(120.0f, 400.0f, 5.0f);
     51    m_velocity = vec3(0.f);
    5252    state = FALLING;
    5353}
     
    6464            for (int i = 0; i < 10; i++)
    6565                if (enemies[i]
    66                      && enemies[i]->position.x > position.x + 60.0f - 30.0f
    67                      && enemies[i]->position.x < position.x + 60.0f + 30.0f)
     66                     && enemies[i]->m_position.x > m_position.x + 60.0f - 30.0f
     67                     && enemies[i]->m_position.x < m_position.x + 60.0f + 30.0f)
    6868                {
    6969                    must_kick = true;
     
    7777            else
    7878            {
    79                 velocity.y = JUMPVEL;
     79                m_velocity.y = JUMPVEL;
    8080                state = JUMPING;
    8181            }
     
    8787        break;
    8888    case FALLING:
    89         velocity.y = -JUMPVEL;
     89        m_velocity.y = -JUMPVEL;
    9090        state = DASHDOWN;
    9191        break;
     
    103103    flytime = fmod(deltams + flytime, 400.0f);;
    104104
    105     vec3 oldvel = velocity;
     105    vec3 oldvel = m_velocity;
    106106    switch (state)
    107107    {
     
    116116        break;
    117117    case FALLING:
    118         velocity.y -= deltams * GRAVITY;
    119         position += (oldvel + velocity) * (0.5 * deltams);
    120         if (position.y < 81.0f)
    121         {
    122             position.y = 81.0f;
     118        m_velocity.y -= deltams * GRAVITY;
     119        m_position += (oldvel + m_velocity) * (0.5 * deltams);
     120        if (m_position.y < 81.0f)
     121        {
     122            m_position.y = 81.0f;
    123123            state = WALKING;
    124124        }
    125125        break;
    126126    case JUMPING:
    127         velocity.y -= deltams * GRAVITY;
    128         position += (oldvel + velocity) * (0.5 * deltams);
    129         if (velocity.y < 0.0f)
     127        m_velocity.y -= deltams * GRAVITY;
     128        m_position += (oldvel + m_velocity) * (0.5 * deltams);
     129        if (m_velocity.y < 0.0f)
    130130            state = FALLING;
    131131        break;
     
    134134        if (walktime >= LEN_KICKAIR)
    135135        {
    136             velocity.y = 0.0f;
     136            m_velocity.y = 0.0f;
    137137            state = FALLING;
    138138        }
    139139        break;
    140140    case DASHDOWN:
    141         velocity.y -= deltams * GRAVITY;
    142         position += (oldvel + velocity) * (0.5 * deltams);
    143         if (position.y < 81.0f)
    144         {
    145             position.y = 81.0f;
     141        m_velocity.y -= deltams * GRAVITY;
     142        m_position += (oldvel + m_velocity) * (0.5 * deltams);
     143        if (m_position.y < 81.0f)
     144        {
     145            m_position.y = 81.0f;
    146146            state = FUNKING;
    147147        }
     
    188188    Scene::GetDefault()->AddTile(pigeon_flying, (int)(flytime * 2 / 400.0f), ivec3(81, 147, 5), 0, vec2(3.0f));
    189189
    190     Scene::GetDefault()->AddTile(active_set, active_frame, ivec3(position), 0, vec2(3.0f));
     190    Scene::GetDefault()->AddTile(active_set, active_frame, ivec3(m_position), 0, vec2(3.0f));
    191191}
    192192
  • trunk/mrpigeon/redenemy.cpp

    r1211 r1300  
    3030    enemy_casualredfall = Tiler::Register("mrpigeon/gfx/enemy_CasualRED_fall.png", ivec2(16,24), ivec2(0));
    3131
    32     position = vec3(512, 81, 0);
    33     velocity = vec3(-0.15f, 0, 0);
     32    m_position = vec3(512, 81, 0);
     33    m_velocity = vec3(-0.15f, 0, 0);
    3434}
    3535
     
    4242    enemytime = fmod(deltams + enemytime, 700.0f);;
    4343
    44     position += velocity * deltams;
     44    m_position += m_velocity * deltams;
    4545}
    4646
     
    5050
    5151    /* + 48 because of vertical flip */
    52     Scene::GetDefault()->AddTile(enemy_casualred, (int)(enemytime * 6 / 700.0f), position + vec3(48.0f, 0, 0), 0, vec2(-3.0f, 3.0f));
     52    Scene::GetDefault()->AddTile(enemy_casualred, (int)(enemytime * 6 / 700.0f), m_position + vec3(48.0f, 0, 0), 0, vec2(-3.0f, 3.0f));
    5353}
    5454
Note: See TracChangeset for help on using the changeset viewer.