I am attempting to construct my game engine as flexible as possible. I have programmed object physics (Gravity and horizontal movement) into a single group (Group.0), as I intend to make both the player and multiple enemy units feed of the same lines of code. This has worked flawless up until I started involving child objects, specifically censors/detectors...
I have no issues whatsoever creating parent/child conditions for a single object, but as soon as duplicates are involved (such as multiple enemies) I hit the brick wall...
No matter how much I try, I never find a solution for this...
As of now, neither the player or the enemies responds correctly to the semi-platforms(The line you can jump through, but not fall through), the player and just one of the enemies seems to pair with the censors correctly, and jumping is not possible.
I have included the source code for download. Please feel free to have a look! I hope you find the code understandable. :pacman:
My primary objective now is to make all four detectors (top, ground, left, right) pair with each individual(The player and enemies) respectively. I want the player to respond to jumping, regardless if there are enemy ground censors overlapping the floor or not, and I want all of the objects to land on the semi-platforms correctly.
In further development, both the enemy and player will have additional child objects linked to them, including individual weapons, and sets of sprites, which just digs further down the complexity of this.... Dear, my head starts to spin just thinking about it..
I will not be able to continue development until I grasp a better understanding of this....
Help is very much appreciated and recieved with overwhelming gratitude! Please login to see this attachment.