Enemy Collisions / Platformer (Glitch)
I'm building a tradition Platformer, think Mario. I told Gamesalad to detect the bottom of my actors and the top of enemies, so when my player jumps on an enemy it's destroyed. Otherwise, if my player comes into contact with an enemy, the player is destroyed. Additionally, the enemies patrol right and left, changing direction when they collide with walls.
Everything worked. At first.
I built two scenes with enemies on multiple levels and everything played out the way it was suppose to. Then, I copied scene 2 to make my third scene.
This is where things get weird.
When I lay down my first platform at the bottom of the scene and add enemies, everything work fine. However, when I add an enemy on a elevated platform, my player is no longer able to destroy the enemies. Instead, the player is destroyed. Every time.
I thought it might have something to do with the copied scene, so I deleted it and started from scratch. Still, starting with a blank scene, I had the same issue. I went back and checked my Prototype Enemies against the enemies in my scenes that were working. Everything was the same.
I even went back and attempted to add additional platforms to my first two scenes, and when I did, my enemies in those scenes stopped working properly as well.
I've tried everything I can think of to root out the problem, but I can't seem to track down why my enemy / player collisions stop working properly, but only when I add platform at a higher elevation than the base platform. However, my first two scenes are still working correctly.
Any ideas?
Comments
It's almost as if the rules governing the detection of the top of the enemy, or the bottom of the player just stop working. It doesn't really make sense. Especially since they work on level 1 and 2.
PS I tried duplicating the enemy prototype and setting up new player rules, but I'm still having the same issue.
For some reason, changing the order in which the enemies are added to the scene seems to fix the issue. But, it does't really make sense to me why.
It seems, after some trial and error, if I place the enemies in my scene in reverse order, from the end to the beginning, everything works appropriately.
However, I cannot imagine what behavior is causing this.