Make the camera unfollow after player goes backwards 500px?

Get help using Construct 2

Post » Fri Jul 22, 2016 1:54 pm

Message: Programmer25 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hi, Im new here

I have some issues with the camera. I would like:

1. Camera to STOP when the player moves back 500px.

2. When the player touches the left side of the screen, he shouldnt be able to go any furder (hits invisible wall)

3. When player goes back to the middle of the screen, the camera should start following him again.

Could someone help me? Here is a simple template of my game (capx file): (sorry for spaces in link, no rep :( )
https://drive.google.com/ file/ d/0B72RpsDBK__PYWotMjc1ajdtT2c/ view
Last edited by Programmer25 on Fri Jul 22, 2016 6:58 pm, edited 2 times in total.
B
10
S
3
G
1
Posts: 46
Reputation: 1,261

Post » Fri Jul 22, 2016 2:52 pm

@Programmer25

The BoundToLayout behavior should cover what you are trying to accomplish.
If for some reason, you want to stop the ScrollTo behavior, you can create an invisible sprite that, when PlayerBox is overlapping it, disables ScollTo, and Else enables it.
B
16
S
9
G
5
Posts: 74
Reputation: 4,120

Post » Fri Jul 22, 2016 3:29 pm

@SimoneT

BoundToLayout doesnt stop the player go off screen (out of camera view), it only stops him leaving the layout.

Invisible sprite needs to be 500px behind the player when he moves forward, and stop moving when player goes to the left. How do I do that? And the invisible sprite shouldnt move when player is to the left of it. This makes things complicated.

Thank you for the quick responce, but my problem is not solved
B
10
S
3
G
1
Posts: 46
Reputation: 1,261

Post » Fri Jul 22, 2016 3:57 pm

This covers pretty much everything you wanted. I needed to add a "scroll to Y" since deactivating the "Scroll To" temporarily caused the screen to not follow the player on the Y axis.

https://dl.dropboxusercontent.com/u/700 ... fixed.capx
B
74
S
31
G
27
Posts: 1,000
Reputation: 20,710

Post » Fri Jul 22, 2016 4:11 pm

@Magistross

It works! I cant thank you enough, you're a lifesaver :)
B
10
S
3
G
1
Posts: 46
Reputation: 1,261


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests