Jump to content

Photo

Multi Sprite Kernel wall detection?


3 replies to this topic

#1 waderain OFFLINE  

waderain

    Space Invader

  • 25 posts
  • Location:sometimes Arizona, sometimes Montana

Posted Mon Dec 3, 2018 12:36 PM

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?


#2 Lewis2907 OFFLINE  

Lewis2907

    Moonsweeper

  • 297 posts
  • Location:Senatobia, MS

Posted Mon Dec 3, 2018 9:45 PM

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/...4593-lewis2907/

Edited by Lewis2907, Mon Dec 3, 2018 9:46 PM.


#3 waderain OFFLINE  

waderain

    Space Invader

  • Topic Starter
  • 25 posts
  • Location:sometimes Arizona, sometimes Montana

Posted Tue Dec 4, 2018 12:23 PM

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. 



#4 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,251 posts

Posted Tue Dec 4, 2018 5:10 PM

pfread requires an assembly add on in the multisprite kernel.

 

Here is info on the official stuff:

http://www.randomter...nds.html#pfread

 

Bogax also made his own pfread funcitons for multi sprite:

http://atariage.com/...isprite-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/...d/#entry4165992






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users