Jump to content
IGNORED

collision detection in INTV basic using scroll is impossible.


Recommended Posts

Using #TileID=PEEK $0200+(stickmanX/8)+((stickmanY/8)*20) should get you the value of the card your character is on. If I remembered that the screen data starts at address $0200. Then after that do an if statement like 'if TileID=#0301 then stickmanX=stickmanX-1. This is my method of doing software sprite vs Tile collusion in my Colecovision game. I'm not sure how much cycles it uses up due to division and multiplication.

 

I haven't yet done hardware tile vs sprite collusion for the intellivision. The manual states, bit 8 means collision against background pixel (pixel set).

EDIT: I tried the ROM. Both objects have irregular shapes. I would make stick man 2 sprites. The top sprite would be his body, it'll hardware detect if it is feeling the left or the right side of the wall. Being there's a flip variable, then it can use that value to push the character back. Then the feet would hardware detect the floor preventing the sprite from passing through the bottom of the screen. There's 3-4 points of collusion that a character need to detect the floor, walls, and ceiling in a platforming game.

Edited by Kiwi
Link to comment
Share on other sites

I thought of something before I drift off to dreamland. You can do it with one sprite. When move left or right, do collusion detection right after your character either left or right. If it collide, then it push you back. Gravity would be another check, when it is time for your character to be pulled down, it can check if the sprite is in the ground, if it is, then it'll push you up. Then another check when you're jumping, if you're jumping and hitting the ceiling, then it'll push you down. Pretty much like,

 

if (cont1.left) then StickmanX=StickmanX-1 then if COL0 and (bit8 enabled) then StickmanX+1
if (cont1.right) then StickmanX=StickmanX+1 then if COL0 and (bit8 enabled) then StickmanX-1
if jump<>0 then StickmanY=StickmanY+1 then if COL0 and (bit8 enabled) then StickmanY-1
if jump=0 then StickmanY=StickmanY-1 then if COL0 and (bit8 enabled) then StickmanY+1

My intybasic may be rusty. Above should be able to work.

Link to comment
Share on other sites

Do you mean it gets stuck in the coral?

 

1. Once you update a sprite using SPRITE #,x,y,z it's saved in a buffer for next frame (until next WAIT happens)

2. The colision bits are controlled by STIC in that frame.

3. When the frame ends the colision bits are updated (another WAIT)

 

So the colision bits are delayed by two frames. The way to correct it would be to check for colision and once it happens get back by one or two pixels, because your character could be still advancing over.

 

I would suggest to check with PEEK for the coral if you need immediate detection.

  • Like 1
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...