How do I avoid sprite overlapping while following player?

Get help using Construct 2

Post » Fri Sep 30, 2016 10:20 am

Hello,

My game is a top down shooter. I have a player sprite which can move around thanks to 8Movement Behaviour. I have several MOB sprites that on created, start to chase the player thanks to Bullet Behaviour. The problem is, as time passes by, MOB sprites start to overlap and after some minutes, you can't distinguish two of them since they're perfectly overlapping.

How can I avoid this problem? I've tried different solutions but nothing worked. Do You guys have any idea?
B
4
Posts: 3
Reputation: 206

Post » Fri Sep 30, 2016 1:11 pm

Send your .capx. Or show your code to be easier to help.
Hi I am Samuel :)

My google play
B
42
S
10
G
1
Posts: 126
Reputation: 3,278

Post » Fri Sep 30, 2016 2:08 pm

Message: blodsvept can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
martdsam wrote:Send your .capx. Or show your code to be easier to help.


Here is a simplified version .capx of my game.
https://www.dropbox.com/s/wjpvljnav7e54po/ExaampleProject.capx?dl=0

It is very simple, Mobs have bullet behaviour and Player has 8Movement Behaviour and Scroll To.
B
4
Posts: 3
Reputation: 206

Post » Fri Sep 30, 2016 6:08 pm

You can try:
Give the enemy the "Custom Movement" behaviour, and set an event
"Enemy - On collision with: Enemy - Enemy - Push out solid - Nearest"

from this thread discussion (and its links): https://www.scirra.com/forum/viewtopic.php?f=147&t=88155&p=1028130&hilit=overlapping+enemies#p1028130

You will ultimately find the answer is... "not easily done".
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Fri Sep 30, 2016 6:38 pm

Check out the first example here - r0j0-039-s-experiments_t91829

+1 "not easy".
Mistakes were made.
B
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Fri Sep 30, 2016 7:29 pm

chrisinfinger wrote:You can try:
Give the enemy the "Custom Movement" behaviour, and set an event
"Enemy - On collision with: Enemy - Enemy - Push out solid - Nearest"


It works great, thanks :D
B
4
Posts: 3
Reputation: 206

Post » Fri Sep 30, 2016 10:26 pm

B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: Congrats2u, Klarner and 31 guests