Smooth scrolling

Get help using Construct 2

Post » Tue Dec 27, 2011 4:22 pm

How to make the "camera" follow a platform character but with a smooth movement when my character stops or accelerate???
excuse my english.
thanks.alejo2011-12-27 16:24:18
B
16
S
4
G
1
Posts: 7
Reputation: 1,740

Post » Tue Dec 27, 2011 4:28 pm

For a start you can do:
Every Tick
----Scroll to Position X = lerp(scrollx, character.X, 0.05);
          Position Y = lerp(scrolly, character.Y, 0.05);



Change de last value , in this case 0.05 to values between 0 and 1 where 0 doesn't move at all, 0.5 moves at 50% velocity, 1 moves at 100% velocity , that is, same velocity of character. Kiyoshi2011-12-27 16:29:57
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Tue Dec 27, 2011 7:04 pm

Thanks Kiyoshi!!!
i`ll try that.
B
16
S
4
G
1
Posts: 7
Reputation: 1,740

Post » Tue Dec 27, 2011 7:11 pm

Great. Oh, nice avatar :D
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Tue Dec 27, 2011 7:48 pm

thanks, its from a book i illustrate.
http://issuu.com/editorialmaspimienta/docs/casi_pajaro_issuu?mode=window&backgroundColor=%23222222
If you need some art or animations for your games, glad to help if i can.
B
16
S
4
G
1
Posts: 7
Reputation: 1,740

Post » Tue Dec 27, 2011 8:04 pm

If you want nice camera effects is it convenient to have an invisible 'camera' object which has the scroll-to behaviour.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Wed Dec 28, 2011 4:28 am

@alejo Wow great colors and line art :D Very good ! I have some nice ideas already :D~

B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Fri Nov 16, 2012 11:20 pm

This is exactly what I wanted.
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Wed Dec 18, 2013 2:36 am

This works awesome, thank you so much - really got the jitter out of my game for small movements.
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
23
S
7
G
3
Posts: 375
Reputation: 4,797

Post » Mon Oct 24, 2016 8:00 pm

This is great thanks, I love the LERP function, simple but so effective.
B
8
S
1
Posts: 4
Reputation: 358

Next

Return to How do I....?

Who is online

Users browsing this forum: Megavolt, mnashwan and 20 guests