Jump to content
IGNORED

pm collisions with tbxl


ascrnet

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

 

post-11721-125280379112_thumb.png

 

greetings

Edited by ascrnet
Link to comment
Share on other sites

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)

 

post-11721-125280379112_thumb.png

 

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 by Synthpopalooza
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...