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
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Fri Sep 07, 2012 12:41 am

This sounds like fun! I'm working on a solution now.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

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
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

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
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

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
36
S
10
G
6
Posts: 948
Reputation: 11,101

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
33
S
11
G
9
Posts: 381
Reputation: 10,153

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
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

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
39
S
12
G
8
Posts: 580
Reputation: 7,108


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Ethan, Marxally, Naightwolf, pierre244, Ryogo and 18 guests