Tell me how to make the appearance of particles not near the player?

  • I made an appearance of the enemy at any point of the 1000x1000 layout, but the problem is that the enemy can appear directly from or on the players. How to avoid the appearance of the enemy in a radius of say 300 pixels from the player?

    If I ask to degenerate + Player.X and Player.Y then enemies appear generally outside the layout.

  • make it appear and then do distance and if too close destroy it and make it appear again and so on ?

  • make it appear and then do distance and if too close destroy it and make it appear again and so on ?

    Yes, this is a good idea. Thank.

    But it will not be optimized.

    By the way, if you do such a check, it will destroy all the enemies that will approach the player

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ok then push it away instead of destroying it to the edge of what you dont want it to go

  • Enemy.X = random(0+(Player.X-300)) to make it appear on the left side and

    Enemy.X = random(1000-(Player.X+300))+(Player.X+300) to make it appear on the right side

    Do same for Y if this is a top down game

  • By the way, if you do such a check, it will destroy all the enemies that will approach the player

    no because the check happens upon enemy generation trigger for that specific enemy, not all the time for every enemy

  • > By the way, if you do such a check, it will destroy all the enemies that will approach the player

    no because the check happens upon enemy generation trigger for that specific enemy, not all the time for every enemy

    Understood thanks, so I did something wrong)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)