[Behavior] Parallax background for side-scrolling games

Post your completed addons to share with the community

Post » Sat Jan 02, 2016 3:41 am

Thank You :D
~Everyone can make GAMEs~
B
55
S
11
G
1
Posts: 414
Reputation: 5,786

Post » Sat Feb 06, 2016 3:35 pm

Why this behavior changes the width of background object?
B
108
S
26
G
266
Posts: 4,455
Reputation: 149,245

Post » Sat Feb 06, 2016 8:41 pm

rexrainbow wrote:Why this behavior changes the width of background object?


The behavior uses the original texture's width. It sets the object's width to N times the texture width. Where N is computed so that the background will cover the entire screen.

For example, if the texture is 100 pixels wide, and the screen is 800 pixels wide, then this behavior will set the background's width to 1000 pixels.

Why? Because that's easier than using the initial object's width, or a custom property, instead of the texture width.

I want to avoid scenarios where a user might add this behavior to one of her backgrounds and forget to set its width properly, causing the background to not wrap seamlessly at runtime.

The behavior is specific to side-scrolling games. I could have implemented a lot of possible scenarios and added a lot of parameters, actions, conditions, etc. However, in practice, most developers would want their background object to display the whole texture.

If the texture itself is not tileable, it would be useful to have the ability to tell the behavior which width to use in an action or as a property. But then again, most developers will use tileable background images made by an artist who spent a lot of time making sure the texture is seamless, so there is no need for the behavior to handle this case and over-complicate things for the user.

I hope I answered your question @rexrainbow.
ImageImage
B
42
S
13
G
10
Posts: 164
Reputation: 7,625

Post » Sun Feb 07, 2016 2:07 am

Thanks. It seems that this behavior only suitable for tile background object only, background made by sprites would have problem since the width had been extended.
B
108
S
26
G
266
Posts: 4,455
Reputation: 149,245

Post » Sun Feb 07, 2016 2:30 am

rexrainbow wrote:Thanks. It seems that this behavior only suitable for tile background object only, background made by sprites would have problem since the width had been extended.


Yes, I designed this behavior to be mainly used for TiledBackground objects. I have not tested it with sprites.

Thank you for checking it out!
ImageImage
B
42
S
13
G
10
Posts: 164
Reputation: 7,625

Post » Sun Feb 07, 2016 2:49 am

I had made another behavior name rex_cameraFollower (source code) which could move object following to camera with a speed ratio, to simulate parallax feature. This behavior could co-work with scroll-to behavior.
But my behavior does not support "wrap" feature.
B
108
S
26
G
266
Posts: 4,455
Reputation: 149,245

Post » Tue Jan 31, 2017 6:25 pm

Could there be an update for this awesome plugin that could duplicate a sprite x-amount of times to cover the screen width? For animated backgrounds this might be easier than manually animating with tile swapping?
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253

Post » Wed Feb 01, 2017 10:38 am

Zebbi wrote:Could there be an update for this awesome plugin that could duplicate a sprite x-amount of times to cover the screen width? For animated backgrounds this might be easier than manually animating with tile swapping?


That's a great idea, thank you for suggesting it.

I will update the behavior soon with this feature. To keep things organized, I will create another behavior to be used on Sprites instead of Tiledbackgrounds. This behavior will be added to the product package, so if you've already purchased it, you'll get it as a free update.

Feature requests are always welcome, if they are within the scope of the product, I will gladly include them.
ImageImage
B
42
S
13
G
10
Posts: 164
Reputation: 7,625

Post » Wed Feb 01, 2017 12:57 pm

Zed2100 wrote:
Zebbi wrote:Could there be an update for this awesome plugin that could duplicate a sprite x-amount of times to cover the screen width? For animated backgrounds this might be easier than manually animating with tile swapping?


That's a great idea, thank you for suggesting it.

I will update the behavior soon with this feature. To keep things organized, I will create another behavior to be used on Sprites instead of Tiledbackgrounds. This behavior will be added to the product package, so if you've already purchased it, you'll get it as a free update.

Feature requests are always welcome, if they are within the scope of the product, I will gladly include them.

No problem, look forward to it!
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253

Post » Wed Feb 01, 2017 4:10 pm

@Zebbi I forgot that I was also offering this addon for free, that's why I talked about the free updates. I thought I was replying on the asset store thread. :D

Anyway, I will also offer the version 1.1 (the new update) for free, if you feel that this addon is adding some value to your project and if you want to support my work, please consider purchasing a license on the store.
ImageImage
B
42
S
13
G
10
Posts: 164
Reputation: 7,625

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 6 guests