How do I use an animated tiled background?

Get help using Construct 2

Post » Tue Sep 08, 2015 5:04 pm

Is it possible to have an animated tiled background? I have a gif and I want it to look like the ground is moving to the left (as if the character is running) and I thought using tiled bg would be the way, but I just realized that they don't have a frame-window. Is it possible to make it animated some other way?
Website Twitter Indie Developer
B
20
S
6
G
4
Posts: 206
Reputation: 2,954

Post » Tue Sep 08, 2015 7:46 pm

Hey!

As you figured out, there is no way to 'animate' your tiled background.
(Just save the picture, it's too big..)
Image
Because I can't post links on the forum, I have screenshotted how I fixed the problem.Basically was happens is when woodFloor1 it's pivot point hits 0x, it spawns back to 640x (Just multiply the screen width.)
With a bullet behavoir it looks like it's moving, and because the same tiled background (woodFloor2) follows, it looks like it's being animated.

There is a lot of room for improvement though with this kind of method. For some reason I got sometimes some white gaps between the two. (Maybe add a third backgound, or put the tiled background closer together.

Hope this helps!

Patrick
B
3
Posts: 6
Reputation: 191

Post » Wed Sep 09, 2015 6:16 am

thanks
Website Twitter Indie Developer
B
20
S
6
G
4
Posts: 206
Reputation: 2,954

Post » Wed Sep 09, 2015 8:32 am

@patrickscheper so now I noticed what you meant by the gaps you get. Does anyone know a good solution for this? After a while, there's a small gap between the 2 ground-objects and it just gets bigger for every time it moves. Solution, anyone? :D
Website Twitter Indie Developer
B
20
S
6
G
4
Posts: 206
Reputation: 2,954

Post » Wed Sep 09, 2015 8:56 am

Solved it by instead of setting the X position to a pixel, I set it to the previous ground + the width of the ground objects. In this case, it was like this:
Ground -> Set X: Ground2.X + 854
Website Twitter Indie Developer
B
20
S
6
G
4
Posts: 206
Reputation: 2,954

Post » Wed Sep 09, 2015 9:18 am

A way to limit the gap is to also have wide tiled background than the project's window size.
Moreover, don't check the left X limit at 0 but TiledBackground.Width * -1
This way, the second TiledBackground is already on screen, and all you have to do is to set the TiledBackground "out of screen" left to the far right, at the exact X where the current TiledBackground is.

Example capx
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483


Return to How do I....?

Who is online

Users browsing this forum: marcinkowski, user5487 and 4 guests