// ************************* // Object subroutines // ************************* void UpdateObjects() { long t1, t2, t3, t4; for (t1 = 0; t1<200; t1++) { switch(Objects[t1].type) { case GEM: Objects[t1].y += 1; if ((Counter % 200) == 0) Objects[t1].y -= 200; t2 = Collided((Objects[t1].x >> 2), (Objects[t1].y >> 2), 16, 16, (PXPos >> 2), (PYPos >> 2), 32, 62); if (t2 == 1) { Objects[t1].d = 255; } else { Objects[t1].d = 0; } break; case WALKER: t2 = GetBlockStatus((Objects[t1].x >> 2) + 7, (Objects[t1].y >> 2) + 16); t3 = GetBlockStatus((Objects[t1].x >> 2) - 1, (Objects[t1].y >> 2) + 7); t4 = GetBlockStatus((Objects[t1].x >> 2)+ 16, (Objects[t1].y >> 2) + 7); if ((t2 == -1) || (t3 != -1) || (t4 != -1)) { Objects[t1].WALKERVELOCITY = -Objects[t1].WALKERVELOCITY; } Objects[t1].x += Objects[t1].WALKERVELOCITY; t2 = Collided((Objects[t1].x >> 2), (Objects[t1].y >> 2), 16, 16, (PXPos >> 2), (PYPos >> 2), 32, 62); if (t2 == 1) { Objects[t1].d = 255; } else { Objects[t1].d = 0; } break; } } }