How do I make camera follow hero in Zelda GB-style?

Get help using Construct 2

Post » Thu May 08, 2014 4:40 pm

I'm trying to make a gameboy-style Zelda dungeon. It's a top-down, 8-directional movement sword and sorcery adventure.

I want this effect (it's complex to explain, so bear with me):

The camera should center on the hero as long as the camera window is not touching a wall. When the camera window is touching the wall, the hero moves around within that window space until the hero pulls away from the wall enough to center the hero back in that camera window.
VIDEO EXAMPLE: [https://www.youtube.com/watch?v=cec7dyk0Khw]

See how the room is bigger than the window size, but the window is bound to the edge of the room? That is what I want. In other words, I want the window bound to the edges of the rooms, but I want the hero to be bound to the window, and I want the window to center on the hero unless the window is bound by the room.

Please know that I do not want to have a separate layout for every room within a dungeon.

Any advice?
B
2
Posts: 2
Reputation: 154

Post » Thu May 08, 2014 7:36 pm

Make a sprite called zone. That will be your "camera zone". Overlay every room with it, separetely. So you clone it (CTRL + drag)
Something like this Image

Then, use this event. The settings (400 and 256) depend on the size of your layout. Put half and half in each.

Image

Make a layer intended for the zones, it'll make it easier to map and you'll be able to lock them.

I got this from a capx I found around the forums.
B
33
S
9
G
3
Posts: 493
Reputation: 4,042

Post » Thu May 08, 2014 9:06 pm

B
63
S
19
G
8
Posts: 341
Reputation: 12,130

Post » Fri May 09, 2014 3:11 am

Yep, that's the one. Thanks zatyka!
B
33
S
9
G
3
Posts: 493
Reputation: 4,042

Post » Wed May 21, 2014 8:11 pm

Thanks, guys. Very helpful!
B
2
Posts: 2
Reputation: 154

Post » Tue Jul 08, 2014 9:46 pm

very helpful, thanks
B
13
S
5
G
1
Posts: 119
Reputation: 2,292


Return to How do I....?

Who is online

Users browsing this forum: Mayfly, R0J0hound, tarek2 and 20 guests