ShootMe2 and IShoot2 mishap.

This commit is contained in:
sigonasr2 2023-05-19 19:09:44 -05:00
parent 4e217b29e1
commit f2e66c064e
9 changed files with 1610 additions and 1015 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -2398,13 +2398,13 @@ bool FaceBall::OnUserUpdate(float fElapsedTime)
while (true) {
if (checkPos.x<0 || checkPos.y<0 || checkPos.x>MAP_SIZE.x || checkPos.y>MAP_SIZE.y) break;
vf2d checkVec = { std::cosf(fYaw) * 0.1f,std::sinf(fYaw) * 0.1f };
if (CheckCollision({ checkVec.x,0,checkVec.y }, checkPos, 0.1f)) break;
if (CheckCollision({ checkVec.x,0,checkVec.y }, checkPos, 0.05f)) break;
checkPos.x += checkVec.x;
checkPos.y += checkVec.y;
for (Enemy&e : enemies) {
if (!e.isDead()) {
float dist = std::sqrtf(std::powf(checkPos.x - e.pos.x, 2) + std::powf(checkPos.y - e.pos.z, 2));
if (dist <= e.radius) {
if (dist <= e.radius*2) {
lookingAtText = enemyData[e.GetID()].name;
goto afterPositionCheck;
}