Ignore:
Timestamp:
Apr 29, 2012, 11:55:32 PM (9 years ago)
Author:
sam
Message:

core: tick methods now use seconds, like any sane system.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mrpigeon/redenemy.cpp

    r1300 r1310  
    3131
    3232    m_position = vec3(512, 81, 0);
    33     m_velocity = vec3(-0.15f, 0, 0);
     33    m_velocity = vec3(-150.f, 0, 0);
    3434}
    3535
    36 void RedEnemy::TickGame(float deltams)
     36void RedEnemy::TickGame(float seconds)
    3737{
    38     Enemy::TickGame(deltams);
     38    Enemy::TickGame(seconds);
    3939
    40     deltams *= game->GetSpeed();
     40    seconds *= game->GetSpeed();
    4141
    42     enemytime = fmod(deltams + enemytime, 700.0f);;
     42    enemytime = fmod(seconds + enemytime, .7f);;
    4343
    44     m_position += m_velocity * deltams;
     44    m_position += m_velocity * seconds;
    4545}
    4646
    47 void RedEnemy::TickDraw(float deltams)
     47void RedEnemy::TickDraw(float seconds)
    4848{
    49     WorldEntity::TickDraw(deltams);
     49    WorldEntity::TickDraw(seconds);
    5050
    5151    /* + 48 because of vertical flip */
    52     Scene::GetDefault()->AddTile(enemy_casualred, (int)(enemytime * 6 / 700.0f), m_position + vec3(48.0f, 0, 0), 0, vec2(-3.0f, 3.0f));
     52    Scene::GetDefault()->AddTile(enemy_casualred, (int)(enemytime * 6 / .7f), 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.