Changeset 60940f8 in network-game for common/Player.cpp
- Timestamp:
- Feb 24, 2013, 5:57:03 PM (12 years ago)
- Branches:
- master
- Children:
- 67d032c
- Parents:
- 7b43385
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Player.cpp
r7b43385 r60940f8 95 95 96 96 // if we're at our target, don't move 97 if (pos.x == target.x && pos.y == target.y) 98 cout << "We're already at our target" << endl; 99 else { 100 cout << "equals test:" << endl; 101 float f = 5.0; 102 int i = 5; 103 104 if (f == i) 105 cout << "test passed" << endl; 106 else 107 cout << "test failed" << endl; 108 109 cout << "Player about to be moved" << endl; 110 cout << "cur pos x: " << this->pos.x << endl; 111 cout << "cur pos y: " << this->pos.y << endl; 112 97 if (pos.x != target.x || pos.y != target.y) { 113 98 float pixels = speed * (curTime-timeLastUpdated) / 1000.0; 114 cout << "We need to move " << pixels << " pixels" << endl;115 99 116 100 double angle = atan2(target.y-pos.y, target.x-pos.x); … … 124 108 pos.y += sin(angle)*pixels; 125 109 } 126 cout << "new pos x: " << this->pos.x << endl;127 cout << "new pos y: " << this->pos.y << endl;128 129 110 } 130 111
Note:
See TracChangeset
for help on using the changeset viewer.