How can I check positions to not overlaping?

Get help using Construct 2

Post » Sun Oct 07, 2012 10:58 pm

Hello Everyone,

I'm making a shooting 2D game like Wild Guns (SNES)
If you don't know the game:
http://www.youtube.com/watch?v=1nhruz7nX0Y

I have a character, and I have defined 6 possible positions where the enemies can appear.
So, when the player touch an enemy, this is destroyed, and I create a new object of the type enemy.
The problem I'm facing is that the enemies can appear in the same position (overlaping).
What I want to do (and I can't figure) is how can I detect if a position is used, and if it is then spawn in other position to avoid the overlaping.

Sorry if you don't understand me, sounds a little complicate.
Here is my capx if you want to see by yourself the issue:

http://www.sendspace.com/file/vhnsyu

Thanks in advance.
Image
Image
B
26
S
2
G
1
Posts: 71
Reputation: 2,662

Post » Sun Oct 07, 2012 11:56 pm

Hey Dakiu.

Sorry I dont have the function plugin so I cant look directly. But did you know that if you right click on most events, you get the option to "invert" them (make it the opposite rule).

So if you had a marker where you were spawning enemies, you could invert "Enemy is Overlapping Marker" - which would of course mean whenever the enemy 'isnt' overlapping the marker -> spawn another.

Another idea is to have them spawning after a set periods of time. Maybe once every 10 seconds?
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Mon Oct 08, 2012 2:45 pm

Hello GenkiGenga,

I forgot to mention that I'm using Rex's function plugin.
Right now, I have the positions with coordinates, but your solution to use sprite and check the overlaping looks good.

I'll try to use it.
About the second option, is not useful because I want to have like 3 or 5 enemies at the same time :( and when one dies, instantly appears other
Image
Image
B
26
S
2
G
1
Posts: 71
Reputation: 2,662


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest