Changeset 231


Ignore:
Timestamp:
Jan 19, 2011, 1:34:01 PM (9 years ago)
Author:
sam
Message:

Properly delta-time blinks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/board.cpp

    r230 r231  
    3434    int screen, board;
    3535    Piece *pieces[8][8];
     36    float nextblink;
    3637};
    3738
     
    5556            Ticker::Ref(data->pieces[j][i]);
    5657        }
     58
     59    data->nextblink = 0.0f;
    5760}
    5861
    5962void Board::TickGame(float deltams)
    6063{
    61     if (rand() % 20 == 0)
     64    if ((data->nextblink -= deltams) < 0.0f)
     65    {
    6266        data->pieces[rand() % 8][rand() % 8]->Blink();
     67        data->nextblink = (float)(200 + rand() % 500);
     68    }
    6369    Entity::TickGame(deltams);
    6470}
Note: See TracChangeset for help on using the changeset viewer.