Changeset 316


Ignore:
Timestamp:
Jan 31, 2011, 2:59:12 AM (10 years ago)
Author:
sam
Message:

Desynchronise idle animation and use the latest tiles from Luc.

Location:
trunk/monsterz
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/piece.cpp

    r313 r316  
    3434    int2 cell, pos, src, dst;
    3535    int id;
    36     float speed, timer;
     36    float speed, timer, idle;
    3737
    3838    enum
     
    6666    data->state = PieceData::IDLE;
    6767    data->timer = RandF(DELAY_IDLE);
     68    data->idle = RandF(DELAY_IDLE, 2 * DELAY_IDLE);
    6869}
    6970
     
    240241        data->timer -= deltams;
    241242        if (data->timer < 0.0f)
    242             data->timer = DELAY_IDLE;
     243            data->timer = data->idle = RandF(DELAY_IDLE, 2 * DELAY_IDLE);
    243244        break;
    244245    case PieceData::BLINK:
     
    247248        {
    248249            data->state = PieceData::IDLE;
    249             data->timer = RandF(DELAY_IDLE);
     250            data->timer = data->idle = RandF(DELAY_IDLE, 2 * DELAY_IDLE);
    250251        }
    251252        break;
     
    274275        {
    275276            data->state = PieceData::IDLE;
    276             data->timer = RandF(DELAY_IDLE);
     277            data->timer = data->idle = RandF(DELAY_IDLE, 2 * DELAY_IDLE);
    277278        }
    278279        break;
     
    316317    case PieceData::IDLE:
    317318    {
    318         int off = data->timer * 3 / DELAY_IDLE;
     319        int off = data->timer * 3 / data->idle;
    319320        if (off < 0) off = 0;
    320321        if (off > 2) off = 2;
Note: See TracChangeset for help on using the changeset viewer.