How do I make sliding doors?

Get help using Construct 2

Post » Tue May 27, 2014 2:59 pm

So here is the scenario:
Imagine a 2d side-scroller.
A door is blocking your way
However, activating a lever makes the door slide up, sort of like a garage door.

How would I go about programming that sliding-effect?

Right now the best I've got is a gimmick where activating the lever activates 8-direction UP control.
And when the door is overlapping an "Doorstop" object, the 8-direction control is ignored again.
I've got a picture in the attachement.
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 15
Reputation: 583

Post » Tue May 27, 2014 3:20 pm

If Door is Open & Door.Width is greater than 0 -> Set Door.Width to (Door.Width - 50*dt)
You can reverse this by setting a target width for it to grow to when the player toggles the door.
Alternatively, instead of setting width, you can set the X or Y position of the door so it slides instead of shrinks.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Wed May 28, 2014 7:11 am

thx, will try it out!
B
6
S
1
Posts: 15
Reputation: 583


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 43 guests