Scroll To - Help!

Get help using Construct 2

Post » Tue Mar 11, 2014 4:13 pm

Hello,

I've been working on a game that required custom movement (not sure if this is relevant or not), grid style with smooth sprite animation. All that part works fine, but upon adding the Scroll To behaviour to the Hero Sprite, it doesn't seem to function properly. As my character walks off, the Scroll To function slowly follows the direction the keys are pushed but stops when the keys are released. It seems to mimic the Sprite movement, but at a slower pace allowing the Hero to vanish off the edge of the screen.

Since Scroll To doesn't have much in the way of properties to fiddle with, I'm curious how to get it to stay centered on the Hero. Any help would be wonderful.
B
5
S
1
Posts: 31
Reputation: 437

Post » Tue Mar 11, 2014 5:32 pm

@AlexandrTheGreat - did you create an invisible sprite with ScrollTo behavior and pin it to your Hero sprite?
B
33
S
7
G
8
Posts: 312
Reputation: 8,528

Post » Tue Mar 11, 2014 7:25 pm

I did not. I was just using the Sprite itself, without the invisible portion. Would creating the invisible sprite and Pin fix the issue?
B
5
S
1
Posts: 31
Reputation: 437

Post » Tue Mar 11, 2014 7:50 pm

I have a similiar problem with my flappy bird clone... ScrollTo is centered to the screen and there's no parameter to change it. I don't want my bird stay in the center of the screen, I want it scrolls when the bird is between the left side and middle of the screen.
I tried Pin but the behaviour when it jumps is strange. Why not add a simple offset in the parameter panel to modify scrollTo?

Edit: It's ok now, don't need to pin something, I just use an invisible sprite which has a scroll behaviour
Last edited by Wallygator on Thu Mar 13, 2014 7:44 am, edited 1 time in total.
B
5
S
1
Posts: 22
Reputation: 448

Post » Wed Mar 12, 2014 1:45 pm

@Manley: I added the invisible sprite as recommended, and changed around the events. However, the Scroll To behaviour is still scrolling at a slower rate than movement.
B
5
S
1
Posts: 31
Reputation: 437

Post » Wed Mar 12, 2014 1:57 pm

you mean like simple screen scrolling
You do not have the required permissions to view the files attached to this post.
B
245
S
39
G
15
Posts: 1,946
Reputation: 40,266

Post » Wed Mar 12, 2014 2:07 pm

@LordShiva1948

I've attached what is currently happening. I've made the "invisible sprite" visible and blue, but translucent to monitor how it's interacting with the animation.

Most of the events at this point are related to the Custom Grid Movement. It's a 64x64 grid, yet the Scroll To feature is only seems to be moving at 32 pixels.

@Scirra: I really wish you'd add a Grid Movement option.
You do not have the required permissions to view the files attached to this post.
B
5
S
1
Posts: 31
Reputation: 437

Post » Wed Mar 12, 2014 2:24 pm

Soon as I have time I will sort it out for you
B
245
S
39
G
15
Posts: 1,946
Reputation: 40,266

Post » Wed Mar 12, 2014 2:27 pm

Thanks a ton. Any help is greatly appreciated.
B
5
S
1
Posts: 31
Reputation: 437

Post » Wed Mar 12, 2014 2:53 pm

@AlexandrTheGreat - as best practice, I think you want to give all the movement behaviors to invisible sprite, and pin the Hero sprite to that. But regardless, I tested your CAPX and see what you mean. The scrollx and scrolly are going by 32 and your Hero sprite by 64. I wonder if it has something do with your sprite's origin?
B
33
S
7
G
8
Posts: 312
Reputation: 8,528

Next

Return to How do I....?

Who is online

Users browsing this forum: bluesun66, Yahoo [Bot] and 10 guests