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

Get help using Construct 2

Post » Tue Dec 09, 2014 12:10 pm

lineofsightturretenemycollisionissue1.capx
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.
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 38
Reputation: 417

Post » Wed Dec 10, 2014 10:14 pm

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.
B
6
S
1
Posts: 38
Reputation: 417

Post » Mon Dec 15, 2014 11:46 pm

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.
B
6
S
1
Posts: 38
Reputation: 417


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 7 guests