ascrnet Posted September 6, 2009 Share Posted September 6, 2009 hi I have a problem with player collisions with the playfield in Turbo Basic. It happens that there is no immediate collision detection to 3 or 4 bit graphics collision. How can I fix this so that the detection is instant? here TBXL code PROC JOYRIGHT POKE 53278,0:REPEAT JX=JX-1:POKE 53248,JX UNTIL PEEK(53252)<>0 ENDPROC PROC JOYLEFT POKE 53278,0:REPEAT JX=JX+1:POKE 53248,JX UNTIL PEEK(53252)<>0 ENDPROC greetings Quote Link to comment Share on other sites More sharing options...
JIMPACK Posted September 6, 2009 Share Posted September 6, 2009 (edited) rare problem... you try another order? I have a question ... TBXL when you "run" a program, execute compile by command line or structures? Edited September 6, 2009 by JIMPACK Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted September 6, 2009 Share Posted September 6, 2009 rare problem... you try another order? I have a question ... TBXL when you "run" a program, execute compile by command line or structures? I see your problem. You need to do a POKE 53278,1 to clear the collision registers before checking collisions. That should fix your problem. There is a program included with TurboBASIC called compiler.com which compiles your programs. It is run from the DOS menu. Quote Link to comment Share on other sites More sharing options...
ascrnet Posted September 13, 2009 Author Share Posted September 13, 2009 (edited) hi, the problem still keeps happening, it doesnt matter if it's compiled or interpreted, I left the memory address in one, i dont know why the first bit of PM is not detected. Attached there is a screenshot of it (the player is the yellow circle) greetings Edited September 13, 2009 by ascrnet Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted September 13, 2009 Share Posted September 13, 2009 (edited) hi, the problem still keeps happening, it doesnt matter if it's compiled or interpreted, I left the memory address in one, i dont know why the first bit of PM is not detected. Attached there is a screenshot of it (the player is the yellow circle) greetings Which playfield are you using for your background. Is it COLBK (712) or something else? If it's not COLBK then your collision register will be thrown off. I would like to see your source code if possible. Another thing you might try is setting HITCL$ (53278) to 1 right after you break out of your loop. Also, it might help if you can move your player back to it's previous position before the collision happened, right after the collision is detected. This is helpful if you want your player to stop when he hits one of the playfield objects. Try this: PROC JOYRIGHT POKE 53278,1:REPEAT JX=JX-1:POKE 53248,JX UNTIL PEEK(53252)<>0 JX=JX+1 poke 53248,jx POKE 53278,1 ENDPROC PROC JOYLEFT POKE 53278,1:REPEAT JX=JX+1:POKE 53248,JX UNTIL PEEK(53252)<>0 jx=jx-1 poke 53248,jx poke 53278,1 ENDPROC Edited September 13, 2009 by Synthpopalooza Quote Link to comment Share on other sites More sharing options...
ascrnet Posted September 15, 2009 Author Share Posted September 15, 2009 hi, the color is the COLBK, I think to use the rebound, but the collision is not acuted. It seems relative. Well, here it's all the code if you can look it and tell me what i'm doing wrong. Download greetings Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.