How do I fix my scrolling background

Just started using Construct 2? Post your questions here

Post » Wed Dec 02, 2015 7:03 pm

Hi everyone,

I'm new to construct and I really like it. I'm trying to do a small test game where a horse has to jump over stones.
To fake the running of the horse I have 3 scrolling backgrounds.

I added each background twice (one time in the main scene and once out of the scene) both parts are scrolling with the same speed.
If one is out of the screen (Checking with IsOutOfLayout) it's position is set to the right out of screen and it can scroll again.
It's working very well except the fact that there is a small gap between the first and the second background (only if it was reset!) and this gap is getting bigger the faster the background scrolls.

I tried several things like setting the background to windowWidth - 1 pixel or windowWidth - speed of background or reset the background if it's x position is on 1 - backgroundwidth etc. but nothing worked.
Any one has an idea?
You can see the problem here:
fs5.directupload.net/images/151201/alouvgwt.jpg

If you want to have a look into the project, download it here:
file-upload.net/download-11088144/Horsegame.zip.html

Thank you all :)

Btw:
If you have a look into the project and you see other things which could be done better, feel free to tell me. As said I'm new to it (started yesterday :D).

P.S. Im sorry I'm not allowed to post the urls correctly :(
B
5
Posts: 15
Reputation: 241

Post » Wed Dec 02, 2015 7:17 pm

Why are you using C2 version 206? This is a very old version from May.

I would advise updating to at least the latest stable version, just in case there are bugs affecting you that may have already been fixed.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
137
S
31
G
87
Posts: 5,557
Reputation: 60,458

Post » Wed Dec 02, 2015 8:16 pm

Whoops you're right my version is freaking old!
Downloaded it a long time ago but only found time now.

Was so excited to finally start that I totally forgot to check for new versions.
Thanks!

But I don't think that will fix the problem.

Edot: Updated to newest version and as thought, doesn't help or change anything. Anyway thanks for the hint :)
B
5
Posts: 15
Reputation: 241

Post » Wed Dec 02, 2015 8:36 pm

you should move relative to the one still within viewport..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Dec 02, 2015 8:58 pm

LittleStain wrote:you should move relative to the one still within viewport..


I'm sorry I don't understand what exactly you're meaning.
Would it be possible to go into further details.

Thank you :)
B
5
Posts: 15
Reputation: 241

Post » Wed Dec 02, 2015 9:10 pm

You want it to fit nicely to the last one, so you should set the position based on boundingboxright of the last one..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Dec 03, 2015 7:58 am

Ok I see what the idea behind it is.

But how can I force it to jump to the bounding box right of the second background? I tried and it's always jumping to it's own right.
B
5
Posts: 15
Reputation: 241

Post » Thu Dec 03, 2015 11:37 am

Instead of re-inventing the wheel, why not do it this way:

https://dl.dropboxusercontent.com/u/485 ... croll.capx
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Dec 03, 2015 5:57 pm

Okay very cool it's working now.

Thank you very much LittleStain :)
B
5
Posts: 15
Reputation: 241


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests