enemies fixed

Get help using Construct 2

Post » Mon Sep 14, 2015 9:20 am

How I can make enemies do not mix on a same image? Any posibilities ?

example
http://www.mediafire.com/view/jiiy3rxv653cknx/example.jpg
B
10
S
4
G
1
Posts: 80
Reputation: 1,618

Post » Mon Sep 14, 2015 9:28 am

You mean that they don't overlap?
How does the enemies spawn? Do you spawn 3 enemies at the same time?

Explain abit more of what you are trying to achieve.
B
14
S
5
G
1
Posts: 32
Reputation: 1,038

Post » Tue Sep 15, 2015 9:05 pm

When enemies come together and see only an enemy although there are several in the same place. Sorry my english
B
10
S
4
G
1
Posts: 80
Reputation: 1,618

Post » Wed Sep 16, 2015 6:29 pm

Something like this could work:
Code: Select all
global number prevX = 0

+-----------------------------------+
| for each enemy ordered by enemy.x |
+-----------------------------------+
    |-------------------------------+
    | system compare: loopindex > 0 | enemy: set x to prevX
    | enemy x < prevX + 32          |
    +-------------------------------+
    |-------------------------------+
    |                               | set prevX to enemy.X
    +-------------------------------+


That takes the enemies left to right and keeps them at least 32 pixels apart.
For a game like yours you could handle the enemies left and right of the player separately so you'd push from the player.
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Thu Sep 17, 2015 10:01 am

B
10
S
4
G
1
Posts: 80
Reputation: 1,618


Return to How do I....?

Who is online

Users browsing this forum: tdcostas and 4 guests