Is it a bad idea to have many-layered backgrounds?

For questions about using Classic.

Post » Tue Mar 29, 2011 12:08 am

Bump, just in case people didn't see my new question.

(Thanks again for the answers!)
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Tue Mar 29, 2011 1:05 am

There's a number of ways to have the clouds infinitely scroll.

1. You can make them tiled background objects, and use image offset (could take up a good bit of VRAM though)

2. Use ScrollXleft or ScrollxRight and reposition the clouds when they go off-screen. If the cloud's hotspot is in the middle, then something like this:

+Cloud.x < ScrollXLeft-(cloud.width/2)
-Set Cloud position to: ScrollXRight+random(n), 0+random(windowheight)

3. Use the wrap behavior (that might only work well with single-screen levels or small layouts)
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Mar 29, 2011 1:16 am

Incredibly bored, so I whipped this up. Hope it helps!

http://download959.mediafire.com/tt59zd ... bjects.cap

edit: might want to change (displayheight) to (scrollybottom)
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Mar 29, 2011 1:37 am

Wow, looks great! But would that work in a Mario level where the camera's following you as you move?
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Tue Mar 29, 2011 1:41 am

It should! That's what scrollxleft and such are for :wink:

edit: hm. Scrolling to the left kinda messes it up :T I dunno man, maybe someone else can chime in on this.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Mar 29, 2011 1:43 am

I'll implement that and see if I can get it working, then. Good thing you posted the cap, because I had no idea what you were talking about in the previous post. :P Thanks a million!

Edit: Yeah, I'm not really getting anywhere with it. :?
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Tue Mar 29, 2011 5:22 am

[url:3emsjfeu]http://dl.dropbox.com/u/666516/fluffy.cap[/url:3emsjfeu] :D
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Tue Mar 29, 2011 3:59 pm

I... have no idea what that cap is doing. xD Even if I just copy the events into my project, looks like there's two problems:

- as far as I can see, it doesn't scroll infinitely. It follows the mouse for a few seconds and then it stops. I don't know if that's what it's supposed to do, or there was some error in making it, or an error on my part, etc. etc.

- does it have to randomly generate clouds? I'm making a Super Nintendo-style game, so that would honestly look too good to fit in with all the pixely sprites. :P Can I get it to work with my own sprites?

By your smiley face it seems like this is the ultimate solution to my problem, but I dunno, maybe it's going way over my head. :)
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Tue Mar 29, 2011 4:50 pm

Yeah, it can tile infinitely, but as you said it probably wouldn't work with pixel art.
You would probably do better with the tiled background for that.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Tue Mar 29, 2011 4:59 pm

I see... but that brings me back to square one: how to make a tiled background(or even just sprites) scroll infinitely. :?
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests