Changeset 74b8e79 in network-game for server


Ignore:
Timestamp:
May 18, 2013, 7:21:55 PM (12 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
876add0
Parents:
7d91bbe
Message:

Deleted some commented code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/server.cpp

    r7d91bbe r74b8e79  
    383383               cout << "valid terrain" << endl;
    384384
    385                //cout << "orig x: " << mapPlayers[id].pos.x << endl;
    386                //cout << "orig y: " << mapPlayers[id].pos.y << endl;
    387                // first we get the correct vector
    388385               mapPlayers[id].target.x = x;
    389386               mapPlayers[id].target.y = y;
    390387               int xDiff = mapPlayers[id].target.x - mapPlayers[id].pos.x;
    391388               int yDiff = mapPlayers[id].target.y - mapPlayers[id].pos.y;
    392                //cout << "xDiff: " << xDiff << endl;
    393                //cout << "yDiff: " << yDiff << endl;
    394 
    395                // then we get the correct angle
    396                double angle = atan2(yDiff, xDiff);
    397                cout << "angle: " << angle << endl;
    398 
    399                // finally we use the angle to determine
    400                // how much the player moves
    401                // the player will move 50 pixels in the correct direction
    402                //mapPlayers[id].pos.x += cos(angle)*50;
    403                //mapPlayers[id].pos.y += sin(angle)*50;
    404389
    405390               serverMsg.type = MSG_TYPE_PLAYER_MOVE;
     
    408393               memcpy(serverMsg.buffer+4, &mapPlayers[id].target.x, 4);
    409394               memcpy(serverMsg.buffer+8, &mapPlayers[id].target.y, 4);
    410                //memcpy(serverMsg.buffer, clientMsg.buffer, 12);
    411395
    412396               broadcastResponse = true;
Note: See TracChangeset for help on using the changeset viewer.