Getting squished between two of the same object

For questions about using Classic.

Post » Sun Aug 08, 2010 9:20 pm

I need to know if there is a way to, say, make two walls closing in on each other. (That is the same object) Just mirrored. To crush the player when they hit him on both sides. I'll try to draw here for you..

||-wall -------||same wall mirrored.
||-------------||
||---O-player ||
||-------------||
---> <---

Or do I have to make a wall clone, and name it wall 2. Not that I'm lazy. But I just wondered
if there is a way to do it.
The main reason for my question is making it easier to make my level editor,
with less objects. And easier for the player who wants to make levels.
B
7
G
4
Posts: 32
Reputation: 1,596

Post » Mon Aug 09, 2010 3:06 am

-player-is overlapping wall
---system compare--countmatching("wall") equal to 2
----------player-destroy
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Aug 09, 2010 3:38 am

As far as mirroring the wall, use two instances of the wall, have the event system pick which wall by Player.X (one will be greater and one will be less) and have them move towards the player object
B
2
S
1
G
2
Posts: 35
Reputation: 870

Post » Mon Aug 09, 2010 3:41 am

or give each one a private variable called "direction"
Make one equal 1
And one equal -1

When you choose the xspeed to move
Multiply it by direction
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Aug 09, 2010 2:54 pm

Thanks for the help, will test it out when I get home from work :)
B
7
G
4
Posts: 32
Reputation: 1,596


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest