lionz's Recent Forum Activity

  • You can add the conditions in an OR block.

  • Poor phrasing, I'm saying the condition does do that. I don't see a problem.

  • The condition is saying, if player is overlapping enemy and if player's X is greater than that enemy's x, i.e. enemy is on the left of the player, then do something. Should only detect the x for comparison of the enemy that is overlapping the player.

  • It does do that, that's why I'm asking for the reasoning that it is not doing that. When you say player overlapping with family, it only picks the one you are overlapping. When you also say in the same condition player x greater than family.x it picks that same instance of family that you are overlapping to do the x comparison.

  • This works, but when there are multiple instances from the same family, construct only takes reference of the x value of the enemy I first put down in the layout (rather than the closest one), so if enemy 2 is like 500 pixels +X (right) of enemy 1, the collision still thinks you get hit from the right, no matter where enemy 2 is, even if he is to the left of the player (-x).

    You reference the enemy overlapping the player so it should only pick that enemy, however your logic then goes on to use global variable and no longer reference any enemies, so I don't know how you would know if it was picking other enemies. How are you recording that information?

  • Argh my eyes

  • if you add a for each instance it picks all instances, that should resolve multiple instances coming at you from either side. the enemy damage being combined into one event I resolved above with families.

  • I think the easiest solution would be that if sprites are overlapping, the touch will touch only the sprite on the top of the layer it's currently on.

    That's the way I thought it worked.

    That's not the way it works but you can add logic to make it work like that, if you group all pickable objects into a family and use 'pick top'.

  • You add a 'for each instance' to resolve that.

  • What is the condition you used and added trigger once to, was it 'is overlapping' ? Use bullet on collision with sprite, that triggers once and helps to pick the sprite.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Home button only suspends the app, when they enter the app it should be in the same place. Maybe you meant if they close the app completely and you're looking for a resolution to do with saving the game?

  • I am going to explain how to do it in the sense that an enemy is attacking the player.

    You put all enemy objects, enemyA enemyB enemyC into a family 'enemies'.

    You add a family instance variable to enemies - 'damage'.

    You add other logic, set enemyA.damage to 10, set enemyB.damage to 20, set enemyC.damage to 30 on created.

    Then you have attack logic, enemies(family) on collision with player, subtract enemies.damage from player.

lionz's avatar

lionz

Member since 5 Aug, 2013

Twitter
lionz has 73 followers

Trophy Case

  • 11-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

24/44
How to earn trophies