Keeping Scrolling smooth using ScrollTo?

0 favourites
  • 4 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hello All,

    I am currently working on a platformer with a focus on exploration sort of like a metroidvania style. I have been experimenting with different ways of implementing scrolling to try and make it a smooth process across different devices and computers. I am looking to see if anyone has done any testing around different camera/scrollTo methods that you have found give the most consistent results. Below are the options I have tried and most of them seem to introduce varying degrees of background stutter depending on what device they run on:

    1. Simple applying the ScrollTo behavior to the character object. This works great but shows way too much below the character. You have to create really large sections for flooring, etc... if you don't want the player to see what is below them This is mainly due to the character being centered on the screen when scrollTo is applied to them.

    2. Pinning a "Camera Sprite" to a position above the character. The Camera sprite would then have the scrollTo behavior applied to it. This seems to introduce a good amount of stuttering randomly. Especially when parallax is used for background layers.

    3. Using events to position the camera sprite above the player, and then using the Scroll To action to scroll to the camera sprite. This is all of course done every tick. This seems somewhat smoother than the above option, but when testing on other computers it seems to introduce random stuttering of the background.

    Has anyone played around with the above options or found another option that works better? My goal is to have the scrolling of the layers as smooth as possible and also allow for some flexibility as to where the focus of the scroll is. What I have found so far is the best position seems to be about 150 - 200 pixels above the character. Combining this with adjusting the jump strength helps to ensure they can't see too much below themselves, but can still see the ground when they jump.

    I am open to any better ways of implementing the scroll to/camera behavior to allow for control and smoothness. I have multiple layers though only about 2 or 3 of them have parallax applied to give varying degrees of depth. All other layers are either at 100,100 or at 0,0 for the HUD.

    Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • BluePhaze

    Hi,

    i have been using a sprite with scrollto and moveto behavior. I can control the position with the moveto using acceleration and deceleration. By having the player with the scrollto as well means the camera is mid way between the two.

    I do this mainly to control how much of the screen is in view when the player turns left or right. So when he is facing right the player is 1/3rd the way across from the left and when he turns to face left the sprite moves and he is then 1/3rd from the right.

  • spongehammer Nice, have you had any issues with it in terms of stuttering or jitters when you play fullscreen on different devices or computers?on different devices or computers?

  • BluePhaze

    to be honest i only create stuff for the PC. Never tried it on mobile devices. Seems to work ok on various spec PCs ok though.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)