Scrolling Tiled Background C2

Get help using Construct 2

Post » Sun Sep 25, 2011 5:06 pm

So, I have created a nice Egyptian background (640x480) that I would like to scroll left continuously and I've looked over Classic code until I have thoroughly confused my feeble little brain cells! The last example I looked at was here:


http://www.scirra.com/forum/fog_topic44497_post278614.html?KW=tile+background#278614

I know my tiled background is large but it contains pyramids, a Sphinx, palms, etc and it will tile seamlessly if I can just get it to scroll, dang-it!

Anyone willing to help out a boob, (oops!) er, I mean noob? HeHe...

Thanking you in advance!
B
5
S
1
G
2
Posts: 45
Reputation: 1,315

Post » Sun Sep 25, 2011 5:21 pm

http://dl.dropbox.com/u/36472942/construct/forumhelp/TBScrollingExample.capx

This principle works for any object (sprites, etc...)
It is generaly not advised to have a big background image (as in the tiled texture being big).
You could very well use several layers.
Your bottom layer would contain a TiledBackground (with the sky color for example).
On an upper layer, you would put several smaller sprites (containing your scenery like pyramids, palmtrees, etc... with a transparent background) and make THOSE sprites scroll.
That would make the trick as well, would allow you some multi-parralax effect.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Sun Sep 25, 2011 6:42 pm

Thank you soooo much for the help, Kyatric! Worked like a charm!

I do see a gap occasionally but if I recall correctly, I think this was discussed somewhere else and I think it was said that it disappears after export, is that correct?

So, here is another question... What is the general rule for Sprites and Tiled Backgrounds as far as size? Meaning, they should be no larger than...(pix by pix size and/or byte size)??

My background has all been digitally painted on a single layer so I will either have to slice it up and then put it all back together in C2 and then apply the scroll effect to it or start all over with from scratch! Yuck...

I have all my actual game sprites saved individually, just not my nice large bewful background!

A final note for others wishing to use Kyatric's example, I had to update to the latest release 58 as it did not work on ver 57.

Thanks again, I really appreciate your willingness to help! It is most appreciated!
B
5
S
1
G
2
Posts: 45
Reputation: 1,315

Post » Thu Sep 29, 2011 4:32 am

Hello again,

So I have been busy making my other components for my game and I have been thinking about what I need to do in order to accomplish the suggestions Kyatric made with the background I previously created.

I'm okay with creating the sky, placing it on the bottom layer and adding the sphinx, pyramids, palm trees and other images by virtue of sprites on other layers, but I'm having trouble deciding how best to recreate my original image using this method, mainly because of the rolling sand dunes.

I'm posting my background image and am once again asking for suggestions on how best to replicate or recreate the sand dunes with a tile and still manage to keep it from looking like it is being repeated over and over again. I'm guessing it might be best achieved by stretching and contracting the tile, maybe...

Any suggestions from the pros would be greatly appreciated! Here's my image:




Thoughts and recommendations are welcome! Thanks in advance for all the words of wisdom!

B
5
S
1
G
2
Posts: 45
Reputation: 1,315

Post » Sat Oct 01, 2011 2:23 pm

I am having the same problem also maybe it's a bug. No mater what I try I get the same gap.



B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Sat Oct 01, 2011 3:04 pm

Hello Wink,

I recall reading somewhere that once you exported your game the gap disappeared. I actually haven't tried it yet because I am also creating the same game as a test to try to get it working with the parallaxing layers as suggested by Kyatric but my little player keeps running off the screen and falling into the abyss!

Try exporting and see if that works, maybe we can get some knowledgeable folks to explain the gap and maybe educate us a little on parallaxing layers and missing players!

Have a nice weekend and best of luck with closing the gap in your game!
B
5
S
1
G
2
Posts: 45
Reputation: 1,315

Post » Sat Oct 01, 2011 3:13 pm

@Wink and @MeJustMe: if you post capx of your projecs, it might be easier to give you some help.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Sat Oct 01, 2011 3:19 pm

Hi MeJustMe

I tried exporting my game, and that is the screen shot from the exported game. At first I thought it might be a photoshop issue because sometimes photoshop will leave a 1px empty space on the right side of an image so I cropped the background 1px in from the sides. But the result is the same.

Try giving the bound to layout behavior to your little sprite that keeps running off.

Anyway good luck with your game. I might just start on a different game for now something I know I can make with little issues. lol

Ok thanks Kyatric I will in a few minutes.Wink2011-10-01 15:21:30
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Sat Oct 01, 2011 3:44 pm

Thanks, Wink... I'll give that a try and see if it works.

Hello Kyatric! How are you? I appreciate the response and will surely post my capx if the suggestion to bound the layout on the layer my player is on does not work. I'm trying really hard to learn by looking at the examples provided, but sometimes the more you read and the more you change things, the worse it gets! lol....

Have a nice weekend and I'm sure I'll be supplying my capx just as soon as my hair thins enough that I can see my scalp!! Don't want give up and quit trying too soon! haha...
B
5
S
1
G
2
Posts: 45
Reputation: 1,315

Post » Sat Oct 01, 2011 3:50 pm

Ok here is my capx
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest