What is the BEST way for endless background scroll ?

Discussion and feedback on Construct 2

Post » Sun Apr 17, 2016 2:28 pm

I am thinking of having two background sprite that just keeps on going from right to left and when one goes off screen it rejoins at the back.
Is there a better way to do this ?
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Sun Apr 17, 2016 4:57 pm

You can easily do that by using the "Wrap" behavior.
ImageImageImage
B
64
S
24
G
78
Posts: 666
Reputation: 45,070

Post » Sun Apr 17, 2016 5:13 pm

If it's just one and the same background repeating itself then you could look at Construct 2/Templates folder. There are few templates that uses tiled background to to that.

Wrap behavior is not a good option for a seamless background.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 35,968

Post » Sun Apr 17, 2016 5:40 pm

How about a tile background with a size of ((ImageWidth* N(that will result getting bigger than the window width) * 2)

Event:

*Tile Background X < -Self.Width / 2
----> Tile Background Set X to Self.X + Self.Width / 2

Or you can just check the template : Auto-runner
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
65
S
21
G
90
Posts: 1,124
Reputation: 59,862

Post » Sun Apr 17, 2016 6:07 pm

shinkan wrote:If it's just one and the same background repeating itself then you could look at Construct 2/Templates folder. There are few templates that uses tiled background to to that.

Wrap behavior is not a good option for a seamless background.

Why not? It is a totally a solution if you use it correctly.

EDIT: It also depends on the type of game of course.
ImageImageImage
B
64
S
24
G
78
Posts: 666
Reputation: 45,070

Post » Sun Apr 17, 2016 6:32 pm

"Is there a better way to do this ?"
viewtopic.php?t=90520&start=0
Image ImageImage
B
171
S
50
G
180
Posts: 8,397
Reputation: 113,988

Post » Sun Apr 17, 2016 6:49 pm

@newt that would be perfect, but unfortunately it never worked for me on my galaxy s3 mobile - with webgl on or off it shows just black screen (using XDK).

@TheRealDannyyy for that to work you need two (or more objects) placed in row that will constantly wrap around to make a scrolling seamless. But sometimes (I made quite a few tests in the past) browser jerkiness, slight dt fluctuations or even spawning few objects in same tick could lag one of the objects with Wrap behavior and then you wuld start getting holes between wraps.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 35,968

Post » Sun Apr 17, 2016 8:01 pm

Works with webgl on mobile in browser here. Can't think of a reason it wouldn't work with xdk.
Bug report for @R0J0hound ?
Image ImageImage
B
171
S
50
G
180
Posts: 8,397
Reputation: 113,988

Post » Thu Apr 21, 2016 10:56 am

Make moving background images interchangable to make them feel less repetitive :idea: .

Image
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394

Post » Fri Apr 22, 2016 8:28 pm

The implementation: moving_background_vari.capx
remember to using the power of 2 for moving speed

shmup showcase: https://dl.dropboxusercontent.com/u/659 ... index.html
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests