Scroll to issues, player centered on platform

Discussion and feedback on Construct 2

Post » Mon Sep 17, 2012 5:13 pm


OK, this my first post, so bare with me.

Im building a platform game. When my player is on a platform, the player is centered vertically. I want the view to adjust so the platform level is viewed at the bottom of the screen. Ive seen related post with a capx to download but the capx is broke. Trying to get my head around adjusting scroll to X and Y, but no luck yet.

Thanks in advance
Image
B
71
S
22
G
2
Posts: 671
Reputation: 8,522

Post » Mon Sep 17, 2012 7:07 pm

Did you mean that the camera is centered vertically when the player is on a platform? I can't understand what you're trying to do very well..

If I got it correctly, you want the camera to center on the player when he hits the ground, but you want to make it so the ground stays at the bottom of the screen, is that right?

B
106
S
35
G
37
Posts: 796
Reputation: 25,211

Post » Mon Sep 17, 2012 8:31 pm

Yes, that is, that I want the platform on the bottom of screen when the player lands on it. When the player is on the ground, there is no problem.
Image
B
71
S
22
G
2
Posts: 671
Reputation: 8,522

Post » Tue Sep 18, 2012 12:36 pm

Create a "ScrollBox" object that is always a set +X and +Y from the player, and make that have the ScrollTo behavior. Then you can adjust those values to determine where to position the player (also handy if you want to scroll elsewhere temporarily, like to reveal the horrible boss just off-screen).
B
26
S
5
G
1
Posts: 62
Reputation: 2,335

Post » Tue Sep 18, 2012 1:42 pm

I'm not sure I follow you. Can I have 2 objects with the "Scrollto" behavior?
Image
B
71
S
22
G
2
Posts: 671
Reputation: 8,522

Post » Tue Sep 18, 2012 1:52 pm

Actually, i think I understand. Will give it a try. Thanks
Image
B
71
S
22
G
2
Posts: 671
Reputation: 8,522

Post » Tue Sep 18, 2012 4:55 pm

Brilliant! Works great so far. No detectable gliches. That's what I call "thinking outside the scrollbox".

Thanks
Image
B
71
S
22
G
2
Posts: 671
Reputation: 8,522

Post » Thu Sep 20, 2012 12:08 am

Huzzah!

Yeah, I should have specified to not have ScrollTo on the player. Good work anyways!
B
26
S
5
G
1
Posts: 62
Reputation: 2,335


Return to Construct 2 General

Who is online

Users browsing this forum: andreyin, Eisenhans and 9 guests