# 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
temp3 = (player0x - 14)/4 : temp4 = (player0y - 1)/8
player0x = player0x + 1
left
if !joy0left then down
temp3 = (player0x - 18)/4 : temp4 = (player0y - 6)/8
temp3 = (player0x - 18)/4 : temp4 = (player0y - 1)/8
player0x = player0x - 1
down
if !joy0down then up
temp3 = (player0x - 17)/4 : temp4 = (player0y + 1)/8
temp3 = (player0x - 15)/4 : temp4 = (player0y + 1)/8
player0y = player0y + 1
up
if !joy0up then movedone
temp3 = (player0x - 17)/4 : temp4 = (player0y - 7)/8
temp3 = (player0x - 15)/4 : temp4 = (player0y - 7)/8
player0y = player0y - 1
movedone
any ideas?

##### 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.

Edited by Lewis2907

##### 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 on other sites

Here is info on the official stuff:

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.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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