Scroll To - Help!

Get help using Construct 2

Post » Wed Mar 12, 2014 2:55 pm

I have made CAPX my way how to scroll player with blue invisible player just see how it's done and then do it the way you want using same principal
You do not have the required permissions to view the files attached to this post.
B
257
S
42
G
15
Posts: 1,991
Reputation: 41,411

Post » Wed Mar 12, 2014 7:22 pm

@Manley: Thanks for the tip! Can you explain why it works better? It would help me understand the reason, but if it's just one of those "it just works better" that's fine too.

@Lordshiva: That works fine for me. Great work! I don't suppose you happen to know of a way to turn 8-Direction Movement into Grid style? It's so much simpler than the custom movement events. If not, I'll fiddle around with it later.
B
5
S
1
Posts: 31
Reputation: 437

Post » Wed Mar 12, 2014 7:52 pm

@AlexandrTheGreat - I read that advice here in one of Ashley's tutorials: https://www.scirra.com/tutorials/253/how-to-make-a-platform-game/page-4

If you haven't read that one yet, give it a look over.
B
33
S
7
G
8
Posts: 312
Reputation: 8,528

Post » Fri Mar 14, 2014 8:46 am

Thanks for the tutorial link. It makes a lot of sense, so I shall add it into my good habits. :) It detects the collision much better.

After fiddling with the program a bit, I noticed a peculiar phenomenon. The Scroll To only seems to work if Unbound Scrolling is Yes. If set to No, it doesn't scroll at all. I'm also wondering if it has something to do with the Custom Movement. Perhaps the Scroll To behaviour is set at 32, but since mine is moving at 64, it's not playing nicely.

Edit: I tried setting the Actions; Scroll to Object, and Scroll to X/Y hoping the same functions to make the grid movement work would work on the Scrolling too. No luck. It also doesn't matter whether the Scroll To behaviour is added to the invisible player sprite, or the animation: it behaves the same with the slow scrolling.
B
5
S
1
Posts: 31
Reputation: 437

Post » Fri Mar 14, 2014 8:04 pm

Your problem was that you had the scrollTo behavior on your menu as well, so the scroll was set between the two position.
I did a few modification on your project:
- moved the movement logic into the blue collision box
- make the hero sprite slavishly follow the blue collision box (using Pin)
- moved the scrollTo behavior to the blue collision box instead of the hero sprite. This way you don't have "hero moves -> pin position the blue box -> scroll to blue box" kind of potentially laggy interaction. Now it's more like "blue box move -> scroll to blue box + pin position the hero sprite" kind of flow.
- few personnal tweaks on the layout properties because I'm maniac.

scrollToConflict.capx
Last edited by Yann on Sun Sep 14, 2014 7:07 pm, edited 1 time in total.
B
68
S
22
G
14
Posts: 1,485
Reputation: 16,561

Post » Fri Mar 14, 2014 10:58 pm

@Yann: Ah! Thank you so much! It probably would've taken me ages to figure out that I had put Scroll To behaviour on the menu by accident. That is fantastic, you have no idea how happy that makes me. I had made a number of similar changes to my project after linking it here, but I shall go through and see what else is changed from your version.

I doubt I'll ever forget this "lesson" now that it's solved.
B
5
S
1
Posts: 31
Reputation: 437

Previous

Return to How do I....?

Who is online

Users browsing this forum: John Cutter and 7 guests