Dynamic Camera

Get help using Construct 2

Post » Thu Sep 06, 2012 10:43 pm

I am designing a two player game and I want a camera which tracks both players. I want the camera to zoom in & track their position when the players are close and I want the camera to zoom out when the players separate apart.

Any ideas on how to achieve this?

Cheers.
B
43
S
13
G
8
Posts: 612
Reputation: 7,372

Post » Fri Sep 07, 2012 12:41 am

This sounds like fun! I'm working on a solution now.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,674

Post » Fri Sep 07, 2012 12:44 am

Try a search. I remember seeing an example of this before. I think there was even an example that split into splitscreen when the players moved too far apart, using the canvas plugin.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,620

Post » Fri Sep 07, 2012 12:54 am

Even though @ramones is probably right, I had fun making this solution. You'd obviously need to customize it for your game, but here it is:
https://dl.dropbox.com/u/41931267/2playerscale.capx
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,674

Post » Fri Sep 07, 2012 3:06 am

Goodjob, Sqiddster, it's a great example. You should upload it to the arcade as an example file.
B
37
S
11
G
6
Posts: 962
Reputation: 11,254

Post » Fri Sep 07, 2012 10:40 am

I had a similar dynamic camera in my Ludum Dare48(i didn't finish).In my game i use a group to put the zoom, and then i compare the distances between players to activate and deactivate the zoom to fit your needs,if you don't need full zoom when the players are to close.
By the way sqiddster example is more elegant than mine, i think i'll switch to this cesisco2012-09-07 10:49:08
B
36
S
11
G
9
Posts: 399
Reputation: 10,283

Post » Fri Sep 07, 2012 10:51 am

Nice ! Thanks for the capx :)
B
40
S
9
G
5
Posts: 127
Reputation: 6,609

Post » Fri Sep 07, 2012 11:07 pm

This is the thread I was thinking of: http://www.scirra.com/forum/between-sprites-distance-zoom_topic52047.html It was in the FAQ actually.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,620

Post » Sat Sep 08, 2012 5:34 pm

That is awesome! And yes I'm a dolt I didn't see this in the FAQ.

Your version is the best way I think though, works a treat!
B
43
S
13
G
8
Posts: 612
Reputation: 7,372


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 9 guests