Get solid enemies to pass one another

Get help using Construct 2

Post » Fri Mar 15, 2013 8:43 pm

I have a family called enemies, with platform enemies in the family. These platform enemies have their solid behaviour enabled. Now, what I want to do is have these solid platform enemies to move past each other when they collide. In a sense I need the enemies to push against the player.

The first thing I tryed was this:
System>>>Event: FamilyEnemies on collision with FamilyEnemies
                    >>>>Action: FamilyEnemies set collisions disabled

The problem with this is that I have a solid platform sprite underneath, and that when collisons are disabled, the enemies just fall down through the ground platform.

The logic would be like this:
--->>if FamilyEnemies collides with FamilyEnemies
    ----->>>then Family enemies pass through each other

Does anyone know how I can do this? Help is appreciatedretrodude2013-03-16 22:36:37
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Fri Mar 15, 2013 8:49 pm

I suppose the first question is do your enemies really need to be solid?....
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Fri Mar 15, 2013 9:20 pm

yes, they HAVE to be solid

[QUOTE=Pixel perfick] I suppose the first question is do your enemies really need to be solid?....[/QUOTE]
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Fri Mar 15, 2013 9:29 pm

Well,solids are just that..."solid" and they cannot pass each other.

you can disable the solid behavior when they collide,and once passed re enable....
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Fri Mar 15, 2013 9:49 pm

[QUOTE=Pixel perfick] Well,solids are just that..."solid" and they cannot pass each other.

you can disable the solid behavior when they collide,and once passed re enable....[/QUOTE]


I did try that but the problem is that there is a platform below that is also solid, so when two solid enemies disable their "solid" state they both fall through the platform.

I need it so that the enemy acts as a barricade to push the player back, but when the two enemies collide with each other they should turn off their solid state and pass through. retrodude2013-03-15 21:51:51
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Fri Mar 15, 2013 9:52 pm

When I say to push the player back, I don't mean a knock-back effectretrodude2013-03-15 21:53:02
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Fri Mar 15, 2013 10:03 pm

The only ways I could think of at the moment,would be to hold the y position of the objects while the pass is happening...

or maybe on collision have both objects spawn dummy objects,destroy the originals...the dummies could pass each other,then once passed have the dummy objects recreate the originals.

or maybe have the sprites switch x positions on impact and cover the "switch" with an animated sprite showing the "fake pass".
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Fri Mar 15, 2013 10:19 pm

Hmh...i have an idea, although i dont know how to express it in a theoric way, as im new xD

My idea would be to have 2 scenes, and a player character in each one, one pinned to the other one...
then have one solid in one scene and the other one in the other one, this way they wouldnt collide, and if a player is above one of them, it wouldnt fall down...

Hope this makes some sense, im a newbie, and im just trying to help a little, i dont know the exact commands to do this, im not even sure if you can have two scenes in the same layout, but...well, that would be my idea xD
B
3
Posts: 21
Reputation: 619

Post » Sat Mar 16, 2013 3:43 pm

I'll try the first method

[QUOTE=Pixel perfick] The only ways I could think of at the moment,would be to hold the y position of the objects while the pass is happening...

or maybe on collision have both objects spawn dummy objects,destroy the originals...the dummies could pass each other,then once passed have the dummy objects recreate the originals.

or maybe have the sprites switch x positions on impact and cover the "switch" with an animated sprite showing the "fake pass".[/QUOTE]
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Sat Mar 16, 2013 3:44 pm

I do appreciate the thought, but this wont solve my problem

[QUOTE=Zignide] Hmh...i have an idea, although i dont know how to express it in a theoric way, as im new xD

My idea would be to have 2 scenes, and a player character in each one, one pinned to the other one...
then have one solid in one scene and the other one in the other one, this way they wouldnt collide, and if a player is above one of them, it wouldnt fall down...

Hope this makes some sense, im a newbie, and im just trying to help a little, i dont know the exact commands to do this, im not even sure if you can have two scenes in the same layout, but...well, that would be my idea xD[/QUOTE]
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Next

Return to How do I....?

Who is online

Users browsing this forum: jul, nimos100, SteveKane and 17 guests