I'm having problems calculating the distance of objects when doing in a platformer game:
I have an explosion object (referred to as: objExplosion) and 3 enemies including: objEnemyA, objEnemyB, objEnemyC (all these 3 enemies are children of objEnemiesParent).
I have objExplosion located at the first position 150 from objEnemyA; objExplosion is 250 distance from objEnemyB, objExplosion is 450 distance from objEnemyC. I want that any enemies that are 150 or more from objExplosion will be burned, enemies that are more than 150 and less than 250 will be thrown and if lying down other than the objExplosion distance above 250 nothing will happen. This means like the picture: objEnemyA will be burned, objEnemyB will be thrown and objEnemyC will be fine. So what should I do?
I used my code as follows, but they only work for the burnt case and not the thrown case? Please everyone help me. Thank you. Note: this objExplosion is just an object with an image sprite (not an explosion it's just an object).
I have an explosion object (referred to as: objExplosion) and 3 enemies including: objEnemyA, objEnemyB, objEnemyC (all these 3 enemies are children of objEnemiesParent).
I have objExplosion located at the first position 150 from objEnemyA; objExplosion is 250 distance from objEnemyB, objExplosion is 450 distance from objEnemyC. I want that any enemies that are 150 or more from objExplosion will be burned, enemies that are more than 150 and less than 250 will be thrown and if lying down other than the objExplosion distance above 250 nothing will happen. This means like the picture: objEnemyA will be burned, objEnemyB will be thrown and objEnemyC will be fine. So what should I do?
I used my code as follows, but they only work for the burnt case and not the thrown case? Please everyone help me. Thank you. Note: this objExplosion is just an object with an image sprite (not an explosion it's just an object).
Last edited: