Hey everyone :)
I'm having a bit of trouble with enemies falling through JumpThru Platforms when switching to their Attack State/Animation(or any State/Animation for that matter). As every animation frame is a different size, either a collision box or Origin Point is pushing them down into the JumpThrus.
So, I've decided to set them up a similar way as my Player.
My Player has a basic PlayerBox Sprite, Then has the Player Object with all it's animations set to the PlayerBox X & Y, then set it as a child of that object at the start of each layout.
I'm having a bit of trouble puzzling this out for the enemies, as I currently have 4 platform enemies, and looking to expand on the amount of enemies. I'd like to have all the platform enemies use a single PlatformEnemyBox Object to handle the collisions. I've tried multiple ways to handle this issue.
At the moment, I'm over complicating the issue like I always do. I tend to over analyze, and over complicate things... I'm currently trying create each Enemy Type on different instances of the PlatformEnemyBox Object by using a variable. I'm stuck going around in circles. I'm assuming to do it in this way. I would need to do the following.
- Create a Global String Variable
- At start of Layout, change that Global Variable to each enemy type's name(somehow)
- Then On Start Of Layout > For Each PlatformEnemyBox > System > Create Object > Call that Global Variable to create the proper enemy type for each instance of the PlatformEnemyBox
I'm basically been trying to set it up the same way as my player. But, as it stands, there has been no point in using the family object, because I haven't sorted out a way to create the proper enemy type on each enemy box using variables. So I've basically switched out the Enemies in the Family, with Boxes using a naming convention of "(EnemyNameHere)Box". Then Start of Layout, create the proper EnemyName for each EnemyNameBox.
So I'm still doing excessive work with many different Actions/Events for each EnemyNameBox in the Family. It somewhat works, but it's not mirroring them the same way as it was before. I'd rather be able to use just one box for each enemy type in the family, without having 4 separate boxes in the family. Causing unnecessary use of Actions/Events, making using a Family Object Pointless.
I've got a hot fix at the moment, so when any enemy in the PlatformEnemies Family goes into any other State, it sets the Platform Gravity to "0". Then when the Player goes out of their Line of Sight, they switch back to their Walking state, and go right back to walking on the JumpThru style platforms.
This works just fine for the time being. But, I feel like it would be better in the long run to have a single collision box object, like what I'm doing with the Player & PlayerBox.