Camera: Automatic Vertical Scroll

Get help using Construct 2

Post » Wed Mar 20, 2013 9:22 pm

Hello Scirra Community!

I know there are several tutorials related to the following question, but I just can't find the exact tutorial/forum thread.

How can I make a camera to scroll vertically down, so if it hits the player, the player gets destroyed? The camera must have a movement on its own, and not dependent on a character with "scroll to".

Here's an example from the Second Level of Battletoads:

http://www.youtube.com/watch?v=wPd9TzBFc40

(I don't want the camera to stop).

I'll appreciate your answers!

jegcelorio2013-03-20 21:23:47
B
17
S
4
G
3
Posts: 73
Reputation: 3,723

Post » Thu Mar 21, 2013 4:49 am

The best way that I could think of to accomplish that effect would be to create an invisible sprite with the scroll to behavior, and then have that move on every tick. Then I would check if the player is on-screen each time a movement is made, and if they aren't, then destroy them.

Hope that helps!
B
21
S
7
G
5
Posts: 89
Reputation: 5,967

Post » Thu Mar 21, 2013 5:05 am

Rabidsheep's solution is one option. I'll give you another. I'm not at my main PC at the moment, so my apologies if the terminology isn't correct, but did you try something like:

Every tick: Scroll to Y (Scrolly+60*dt)
If Hero is not on screen: Destroy Hero

You can change the "60" to scroll faster or slower.
B
44
S
13
G
7
Posts: 338
Reputation: 10,389

Post » Thu Mar 21, 2013 6:05 am

Excellent! I'm implementing it to see what happens!

Thanks rabidsheep and zatyka!

B
17
S
4
G
3
Posts: 73
Reputation: 3,723


Return to How do I....?

Who is online

Users browsing this forum: farfetchd83, mjj1990, Yahoo [Bot] and 4 guests