Changeset e5697b1 in network-game for client/Client/main.cpp


Ignore:
Timestamp:
Jan 19, 2014, 8:02:22 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
1f6233e
Parents:
d05c484
Message:

Projectile drawing code moved to the GameRender class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • client/Client/main.cpp

    rd05c484 re5697b1  
    520520            GameRender::drawMap(game->getMap());
    521521            GameRender::drawPlayers(game->getPlayers(), font, curPlayerId);
    522 
    523             // draw projectiles
    524             for (it2 = game->getProjectiles().begin(); it2 != game->getProjectiles().end(); it2++)
    525             {
    526                Projectile proj = it2->second;
    527 
    528                FLOAT_POSITION target = game->getPlayers()[proj.target]->pos;
    529                float angle =  atan2(target.y-proj.pos.toFloat().y, target.x-proj.pos.toFloat().x);
    530 
    531                POSITION start, end;
    532                start.x = cos(angle)*15+proj.pos.x;
    533                start.y = sin(angle)*15+proj.pos.y;
    534                end.x = proj.pos.x;
    535                end.y = proj.pos.y;
    536 
    537                start = mapToScreen(start);
    538                end = mapToScreen(end);
    539 
    540                al_draw_line(start.x, start.y, end.x, end.y, al_map_rgb(0, 0, 0), 4);
    541             }
     522            GameRender::drawProjectiles(game->getProjectiles(), game->getPlayers());
    542523         }
    543524         else if (wndCurrent == wndGameSummary)
Note: See TracChangeset for help on using the changeset viewer.