| 1359 | } |
| 1360 | |
| 1361 | bool PlayerEntity::willCollideWithMap(int dx, int dy, bool checkMiddle) |
| 1362 | { |
| 1363 | float oldX = x, oldY = y; |
| 1364 | bool collide = true; |
| 1365 | |
| 1366 | x = oldX + dx; |
| 1367 | y = oldY + dy; |
| 1368 | if (!isCollidingWithMap()) |
| 1369 | collide = false; |
| 1370 | else if (checkMiddle) |
| 1371 | { |
| 1372 | x = oldX + dx / 2; |
| 1373 | y = oldY + dy / 2; |
| 1374 | if (!isCollidingWithMap()) |
| 1375 | collide = false; |
| 1376 | } |
| 1377 | |
| 1378 | x = oldX; |
| 1379 | y = oldY; |
| 1380 | return collide; |
| 1381 | } |
| 1382 | |
| 1383 | void PlayerEntity::move(int direction) |
| 1384 | { |
nothing calls this directly
no outgoing calls
no test coverage detected