andwn / cave-story-md

A fan port of Cave Story for the Sega Mega Drive
569 stars 34 forks source link

Door Layering #99

Closed andwhyisit closed 7 years ago

andwhyisit commented 7 years ago

Doors sometimes appear on top of other sprites such as enemies (Midorin, the green enemy from the Plantation, is a good example of this) or Jenka's dogs when you carry them on your back.

andwhyisit commented 7 years ago

Sadly now that Kanpachi can finally walk this issue rears its ugly head again.

andwn commented 7 years ago

There are times when the door has to be above objects too (King and Jack after Egg Corridor) so I may have to handle this case by case.

andwn commented 7 years ago

The examples you mention should be good now, but I have not tested the puppy yet.

It's still case by case, but now I can just put moveMeToFront = TRUE; in the AI routine when the ordering is wrong.

andwhyisit commented 7 years ago

The puppy seems to be working, as with the rest.

andwhyisit commented 7 years ago

I am getting this again with Gaudi in the Labyrinth and the large frenzied Mimiga on the Balcony. If there some way to blanket apply this to enemies?

andwn commented 7 years ago

The problem is it's not set it and forget it. Every time the door goes off screen and back again, it's re-inserted to the front of the list. So objects that need to be in front of the doors have to signal the engine every so often to move to the front.

andwhyisit commented 7 years ago

What about doing this on enemy to door collision? Would that work? Not literal collision mind you, more that if an enemy entity's framerects intersect with the framerects of a door.

andwhyisit commented 7 years ago

Grasstown bats can be added to the list (outside Chaco's house).