Ignore:
Timestamp:
Jan 26, 2011, 6:35:55 PM (10 years ago)
Author:
sam
Message:

Use monster eyes as particles for the exploding effect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/piece.cpp

    r294 r297  
    2929
    3030private:
    31     Game *game;
     31    Emitter *emitter;
    3232    Piece *above, *below;
    3333    int tiler;
     
    5353 */
    5454
    55 Piece::Piece(Game *game, int2 cell, int id)
     55Piece::Piece(Emitter *emitter, int2 cell, int id)
    5656  : data(new PieceData())
    5757{
    58     data->game = game;
    59     Ticker::Ref(game);
     58    data->emitter = emitter;
     59    Ticker::Ref(emitter);
    6060    data->above = NULL;
    6161    data->below = NULL;
     
    276276        data->timer -= deltams;
    277277        if (data->timer < 0.0f)
     278        {
     279            float3 pos(data->pos.x + 24, data->pos.y + 177, 5);
     280            int start = data->id + 10;
     281            int stop = data->id + 13;
     282            for (int id = start; id < stop; id++)
     283            {
     284                float3 vel(RandF(-0.3f, 0.3f), RandF(0.2f, 0.3f), 0.0f);
     285                data->emitter->AddParticle(id, pos, vel);
     286            }
     287
    278288            data->state = PieceData::DEAD;
     289        }
    279290        break;
    280291    case PieceData::DEAD:
     
    338349    if (data->below)
    339350        Ticker::Unref(data->below);
    340     Ticker::Unref(data->game);
     351    Ticker::Unref(data->emitter);
    341352    Tiler::Deregister(data->tiler);
    342353    delete data;
Note: See TracChangeset for help on using the changeset viewer.