Parallax Scrolling Question

brawlerbro

New member
Hello! I'm very new to OpenBOR modding but I've been playing OpenBOR games for a good year or so now. I got hella inspired by Magggas' World Heroes Supreme Justice Extra. But it's so short that I wanna add my own levels so I can play more.

My question is, I want to achieve a parallax scrolling effect a background slowly scrolling (e.g. the sky), with another background layer on top of it scrolling slightly faster (e.g. the sea), against a static panel (boat/ pier). Much like in this video: https://www.youtube.com/watch?v=2z4OTRFuLP8.

I've tried bgspeed but in only scrolls the background, which doesn't provide the effect I want. I've tried animating bglayer but a few problems 1) my bglayer doesn't become transparent, the transparency color just registers as black and 2) I don't quite understand how to add the bglayer {xratio} {zratio} {xposition}, etc commmands yet.

I'm very new to this so I'd appreciate patience. If there's an existing answer already, please point me towards it and I'll study.
 
Welcome to the forum brawlerbro!

I didn't see this until just now and I'm about to hit the sack for an exam tomorrow, so I can't go into much detail atm. I can say you'll want to use fglayer rather than bglayer. They do the same basic thing, but fglayer lets you control precisely where on the Z axis the layer falls. Other than that, it's really just a matter of reading up on the parameters and experimenting with the X ratios (those control horizontal scroll rate of layer vs. the play field).

There's no hardcode limit to layers, and there's even an affine effect built in, so you can do some pretty serious depth once you get the hang of it.




HTH some,
DC
 
Welcome BrawlerBro!  8)

Damon posted before me  :-[ but I'll help you anyways

bgspeed is for pseudo travel levels where background is autoscrolling to give illusion of travelling. If you want animation similar to video you posted, you need bgspeed. But if you only need to set parallax, don't bother setting bgspeed.

What you need to set is {xratio} parameter of bglayer or fglayer command.
Here's example from one of levels from Cherry On Top:
Code:
background	data/bgs/tumpeng/back.png
bglayer 	data/bgs/cake/awan.png 0.9 0 0 0 0 0 -1 1 1 0 0 0 0 0 -1
bglayer 	data/bgs/tumpeng/gunung3.png 0.8 0 0 0 0 0 -1 1 1
bglayer 	data/bgs/tumpeng/daunan2.png 0.6 0 0 0 0 0 -1 1 1
bglayer 	data/bgs/tumpeng/daunan.png 0.6 0 0 0 0 0 -1 1 1

You can see different {xratio} setting for each bglayer and the value is smaller for the last two layers. Here's how it looks in game:

HTH
 
:D :D :D :D :D

Thanks to everyone's help, I'm a bit closer to getting my desired effect. I'm still largely unfamiliar with the parameters of it all, but I'm slowly learning.

Here it is! It's not perfect but I'm learning haha

https://www.youtube.com/watch?v=9vlBJg08EVE

 
Back
Top Bottom