How do YOU achieve smooth scrolling?

olster1olster1 Member Posts: 396
edited November -1 in Working with GS (Mac)
A lot of games have some sort of scrolling background. With game salad there are many ways to achieve this. A problem a lot of people, including myself, seem to face is the scrolling might sometimes seem jittery. So how do you achieve a smooth scrolling background? Well I ended up using quantumsheep's suggestion.
quantumsheep said:
You can make your background like this:

Say it's a starfield. Actor size doesn't matter - when you place it in your scene, just stretch it so it fills the screen.

This actor will contain the following

A movement behaviour (say direction 180, speed 90 if you're doing a side scroller).

Then underneath this a single rule:
When
Attribute self.position.X < - self.Size.Width /2

Change attribute self.position.X to self.Position.X + self.Size.Width + game.Display Size.Width

Then, put the actor in your scene as described above, and add a second instance of the actor next to it of equal size.

This will allow smooth scrolling, and will mean you can get rid of the wrap.

Hope that helps :)

Another suggestion is from shaz who posted this.

image

This thread can be used to share how you achieve smooth scrolling and to help out the others int he community.

thanks!

Comments

Sign In or Register to comment.