How do I stop sprite coming on screen&enemy collision issue

0 favourites
  • 3 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • [attachment=0:317znvp3]lineofsightturretenemycollisionissue1.capx[/attachment:317znvp3]Hi,

    I have been slowly creating a top down shoot em up game which is going well, but I seem to have 2 issues with enemies.

    The first issue, is that in order for me to create a new enemy object somewhere I need to also have the object somewhere in the layout screen. Now this is okay for static objects, but when my enemies have bullet behaviour and LOS enabled the off screen sprites come onto the screen which I do not know how to stop them from doing so as they do not need to be there as the actual enemy is comprised of 2 sprites, so I cannot just stick them on the screen (which I have tried) as the turret always seems to get left behind, while the tank moves away.

    The second issue, is that all of the new objects I create on the screen always collide/overun with each other, basically running over each other, so when I have 3 created tanks and they are coming after the player, they will eventually all be on top of each other, which looks bad. I know the point is to kill them off, but sometimes this does not happen. They also seem to just go through all other solid objects on the screen (which have solid enabled) like trees, buildings etc.

    I have tried several things for both of these issues, but cannot seem to fine the resolution.

    When the enemy collide with the player, they just push him around, which is great and expected behaviur, but I cannot seem to get the enemy to do the same with each other and not sure why. I have tried playing with solids and other behaviours but nothing seems to work.

    I have supplied a link and attachment to a very basic capx file which shows both issues that I am having and was wondering if someone would know what the problem is with them.

    Please.

    https://www.dropbox.com/s/5sc9sna87jbhr ... .capx?dl=0

    Thank you.

  • Just a quick update in-case someone else has this issue. I seemed to have got around the problem by adding the 8 Direction behaviour to the enemy sprites and disabling the default control. The enemy now just crash into each other and eventually bump around toward the player to get out of their position.

    Still working on the first issue.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • First issue was easy resolved. I just destroyed the images on start-up. This prevented them from doing anything and did not impact the creation or spawning of the sprites later in the game.

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