Jump to content
Sign in to follow this  
waderain

Multi Sprite Kernel wall detection?

Recommended Posts

I've seen this question in past posts but there doesn't seem to be a resolution to the problem.

 

The code I generally use doesn't work and I'm assuming because the playfield is flipped. This works pretty well for standard games but what would the Y calculation be for the multi sprite kernel?

 

if !joy0right then left
temp3 = (player0x - 14)/4 : temp4 = (player0y - 6)/8
if pfread(temp3, temp4) then down
temp3 = (player0x - 14)/4 : temp4 = (player0y - 1)/8
if pfread(temp3, temp4) then down
player0x = player0x + 1
left
if !joy0left then down
temp3 = (player0x - 18)/4 : temp4 = (player0y - 6)/8
if pfread(temp3, temp4) then down
temp3 = (player0x - 18)/4 : temp4 = (player0y - 1)/8
if pfread(temp3, temp4) then down
player0x = player0x - 1
down
if !joy0down then up
temp3 = (player0x - 17)/4 : temp4 = (player0y + 1)/8
if pfread(temp3, temp4) then movedone
temp3 = (player0x - 15)/4 : temp4 = (player0y + 1)/8
if pfread(temp3, temp4) then movedone
player0y = player0y + 1
up
if !joy0up then movedone
temp3 = (player0x - 17)/4 : temp4 = (player0y - 7)/8
if pfread(temp3, temp4) then movedone
temp3 = (player0x - 15)/4 : temp4 = (player0y - 7)/8
if pfread(temp3, temp4) then movedone
player0y = player0y - 1
movedone
any ideas?

Share this post


Link to post
Share on other sites

Not sure if the link below will help. RT and others have done some work, but from what I can gather it's because there is no pfpixel to use a reference point. Maybe someone else can help with more documentation as I'm still trying to figure something out as well.

 

http://atariage.com/forums/user/44593-lewis2907/

Edited by Lewis2907
  • Like 1

Share this post


Link to post
Share on other sites

I thought just reversing the Y calculation would work but it doesn't. Even though the playfield is flipped it seems the pfread doesn't flip. So if you have your Player0y at 80, to the Y pfread it thinks it at 2...I think., at least that's what it seems like it's doing.

 

I'll keep playing with it but it's starting to make me pull my hair out.

Share this post


Link to post
Share on other sites

pfread requires an assembly add on in the multisprite kernel.

 

Here is info on the official stuff:

http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#pfread

 

Bogax also made his own pfread funcitons for multi sprite:

http://atariage.com/forums/topic/213386-pfread-for-the-multisprite-kernel/

 

Neither option has worked for me. My hunch is that smarted brains could get an example working with bogaxs code.

 

 

I've figured out how to use the ball as the collision object for the player0 sprite. I've provided a proof of concept that collides with walls without visible rebound and also slides against walls.

http://atariage.com/forums/topic/281617-smooth-collisions-using-ball-instead-of-pfread/?do=findComment&comment=4165992

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...