#50956 - THI - Sun Aug 14, 2005 9:46 pm
Hi, i downloaded and installed devkitadv and a simple game( with source code), tank. I did a few conversions to make it a kind of side scroller.
Heres my compiled game http://gbadcdev.emuscene.com/FF/tank.gba.
Heres the problems
*Hit test is only working sometimes.
*Can get damaged when some bombs are in proximity,not actual hit
*sometimes bombs spawn in the middle of the screen
*sometimes bombs dont 'turn off' at x coordinate reaching 0
I feel that the last 2 problems are causing the first two...
thanks for any input, i have tried changing alot of things, every change i do to any factors seems to break the hit test.
Heres my compiled game http://gbadcdev.emuscene.com/FF/tank.gba.
Heres the problems
*Hit test is only working sometimes.
*Can get damaged when some bombs are in proximity,not actual hit
*sometimes bombs spawn in the middle of the screen
*sometimes bombs dont 'turn off' at x coordinate reaching 0
I feel that the last 2 problems are causing the first two...
Code: |
// bomb movement and collision dectection and life removal
for(loop = 0; loop < NUM_BOMBS; loop++) { // if off then random to turn it on if (bombs[loop] == 0) { rnum = RAND(10); if (rnum == 4) { bombs[loop] = 1; // turn it on bomby[loop] = RAND((180-objbomb_HEIGHT)/2); bombx[loop] = 240; } } // move the bombs if (bombs[loop] == 1) { // Changed to scroll bombs left bombx[loop] -= 1; // its on so move it // its on, so check for collision if (bombx[loop] == tankx) { if ( ( ( bombx[loop]+(objbomb_WIDTH/2)) > tankx) && (bombx[loop] < (tankx+objtank_WIDTH/2))) { // collision life -= 2; bombs[loop] = 0; } } if (bombx[loop] <= 10) bombs[loop] = 0; } } // end for bombs |
thanks for any input, i have tried changing alot of things, every change i do to any factors seems to break the hit test.