How do I enemies system collision in a 2D platform

0 favourites
  • 9 posts
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • Hello everybody, I have a little question about de collision system, my game is a 2D platform with RPG elements, actually looks like this

    The problem is when the enemies appear and follow the player's character to attack him, they overlap with each other like this

    If only are a few enemies in the screen the gameplay is ok, but when I have 10 or 12 in screen and 8 of them are at the same sprite is imposible to know how many enemies are here. How I do a collision system for the enemies in a 2D platform?

    Player's character and enemies have the beahivor platform.

  • you can give them the Solid behavior, just make sure that it is enabled when the game starts.

    Right click on the sprite in the Objects window to find Behaviors and when the little window pops up click the plus sign. Solid behavior should be at the top of the list

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Odin

    You can stop the movement when the enemy collides with another one or invert the direction. You must access the image editor and define there the collision polygon and before it, create an event to check collision and add an action to stop the enemies, disabling the platform, for example.

    By the way: nice graphics!

    Good luck.

  • you can give them the Solid behavior, just make sure that it is enabled when the game starts.

    Right click on the sprite in the Objects window to find Behaviors and when the little window pops up click the plus sign. Solid behavior should be at the top of the list

    For some reason if I give enemies the solid behaivor they push up the parallax, in this case the parallax have to be solid too?

  • Hi Odin

    You can stop the movement when the enemy collides with another one or invert the direction. You must access the image editor and define there the collision polygon and before it, create an event to check collision and add an action to stop the enemies, disabling the platform, for example.

    By the way: nice graphics!

    Good luck.

    This is the first think I tried but when the enemies enter in collision and the event deactivated the platform behaivor I can't find a good event to reactivate platform if the collision between that enemy and other is over.

    Thanks for the comment about the graphics!

  • Try to using the invert option (if is not overlapping) or "else", and enable platform again

  • Try to using the invert option (if is not overlapping) or "else", and enable platform again

    Yes but, after that how can I move again the enemies? Because If the character is in the left of screen and 2 enemies come to him but in the way they collisioned...they become 2 bricks.

    After the collision between 2 enemies they still in collision forever. The condition is "not overlaping" or "is not collision" are useless in this case.

  • Odin

    I believe the "pick imagepoint overlapping" event is more efficient in this case.

    Take look at this example: https://www.dropbox.com/s/zidho4tsdyw6m ... .capx?dl=0

  • Odin

    I believe the "pick imagepoint overlapping" event is more efficient in this case.

    Take look at this example: https://www.dropbox.com/s/zidho4tsdyw6m ... .capx?dl=0

    Can you do a fast explanation about the "teste" concept in the imagepoint.X and Y . Because I try to do the example in my game and it doesn't work, i attach a screenshot.

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