MCPcopy Create free account
hub / github.com/Cirrus-Minor/witchblast / willCollideWithMap

Method willCollideWithMap

src/PlayerEntity.cpp:1361–1381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1359}
1360
1361bool 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
1383void PlayerEntity::move(int direction)
1384{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected