Camera movement within restricted values in layout

Get help using Construct 2

Post » Fri Sep 19, 2014 7:54 pm

I have a big layout and i want to restrict the camera within this layout. So what i do is I have a camera object that follows the player on X (due to the way the game is structured) and that works well.
so at the oment i have a trigger in my level that, once the camera touches it, stops the camera from following the player. the result is that the player moves within that camera zone that does not move.

that also works as it should.

now, sometimes i want the camera to stop at a certain point and then later move again at a certain point. i do that with triggers and that works well BUT there is now a jump in X positions in the camera. and here i figured to avoid that, wouldn't it be possible to tell the camera to automatically stop moving when the edge of a area is reached, kinda like when it stops scrolling once the edge of the layout is reached.

i am not sure i am explaining this correctly, though. technically speaking, everything works as it should, it's just not pretty, is all.

so yeah, is there a way to define an area within a layout and bind the camera to that area?
B
7
S
2
Posts: 66
Reputation: 720

Post » Sat Sep 20, 2014 12:09 am

I don't know if this is what you want but I have a sort of flip-screen camera set up that scrolls smoothly when the player hits a certain part of the screen. Basically if the player is within a certain x/y range the camera will move smoothly to the center of that particular screen and stay there until the player exits that boundary, whereby it will then float (using lerp) over to the next designated 'center of the screen'. I've attached a screenshot of my workings - It's probably a horribly inefficient way to do things, but it actually works very well for my purposes. The downsides to this method is it's locked in to a particular resolution (1366 x 768 in this case) and all the values are hard coded and probably getting triggered per tick. If I knew what I was doing I could probably set them up in an array or work out a formula etc, but for now it's doing the trick for me.
amera.jpg
You do not have the required permissions to view the files attached to this post.
B
67
S
25
G
4
Posts: 212
Reputation: 7,084

Post » Mon Sep 22, 2014 11:26 pm

My system is similar, really but I don't use lerp. perhaps i should try lerp, whatever that is, as i have read already in some tutorial to use it, not sure what that was though^^
B
7
S
2
Posts: 66
Reputation: 720

Post » Tue Sep 23, 2014 10:06 am

Try to add MoveTo behavior to the camera it's better than lerp you can change the speed any time you want.
you can find the behavior in the plugins section.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,165

Post » Tue Sep 23, 2014 10:09 am

B
34
S
9
G
3
Posts: 517
Reputation: 5,276

Post » Tue Sep 23, 2014 11:00 am

THanks! This is EXATLY what I need :)
THANKS!
B
7
S
2
Posts: 66
Reputation: 720


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests