hello guys, all right? I didn't mention ParallaxBackground, but I'll do it now so we can use it
because it is very important for 2D platformer games
parallax background, in the most basic concept, is this background that reacts at a different time to the foreground
in our case the foreground is the platforms and the objects that react on it
and the parallax background is this orange background on the screen with the mountains
and it has a different speed to give this depth effect
and having a parallax background makes a difference precisely because it gives unity to the game world
and this world is visible in distinct layers that give the game's scenery a wealth of detail
the parallax background itself is very easy to make: just take the node called ParallaxBackground
you take this node and add a ParallaxLayer and then Sprite
in our game, I still have a test background, but it's already a demo
and I think there are few details needed to understand in ParallaxBackground
and are small details
and what are these details?
1) Parallax Background is an image
it doesn't work like tilemaps
so not many are generated, so it has to be a much larger image than the size of the other objects
in my case I made a 3000 x 3000 image
much larger than other 32x32 objects
but even though it is too big, at some point it will end up and not to be placing multiple 3000 x 3000 objects, you configure Parallax Layer
and in it you configure the mirroring
That's what i do? I set X or Y the pixel distance from where I want to mirror
in my case I put in 2400 X
and so it will take the original image, and when it gets to 2400 X, mirroring will occur creating an identical one next
and the mirroring will always be the same respecting the calculation of 2400 X
you may notice that as it is an example ParallaxBackground the image clipping is not good
so you can see in our badly cropped point here where the image mirroring occurs
and this is an important tip for designing your Parallax Background
when making the background image, there has to be a connection between the two sides of it at the ends
or you will have a bad cut, like mine, that would have to shrink the ends of the mountain so that they touch the end when mirrored
and if you do not do this, the mirroring junction appears and gives no sense of continuity
and that you correct by drawing and testing, drawing and testing until you get the pattern
and after that goes straightening mounted on the sprite to have the correct mirroring structure
and this is pure test, not much to say but learning by doing and making mistakes
but after mirroring we go back to the ParallaxBackground layer
and change the speed bo BaseScale to give the difference in motion between the foreground and background
by default comes as 1 and I decreases to 0.7 for a subtle difference in movement
but this too is criterion; you can slow down or speed up more, to see the background moving at different speeds as you like
the important thing is just to understand that
know the three nodes to make ParallaxBackground (ParallaxBackground, ParallaxLayer and Sprite)
and the sprite image has to be much larger than the other images in the game
and the sprite image has to connect at the ends following a pattern
or you will have the crap mirroring effect, as of my test sprite that I will only fix in the future
thinking about ParallaxBackground is thinking about Tom & Jerry's scenario
the famous old background designs when a running character appeared and the scenery kept repeating
and the mirroring function in ParallaxBackground is exactly the same
have an image that copies itself to generate only one file, not overload the game with huge files
(at this moment I can see perfectly my badly done mirroring)
even with bad mirroring, you can understand the importance of ParallaxBackground
compare the old backgroundless game of the other videos to this one, and you notice the complexity of this world
and so the player is contained in a truly meaningful universe, not just loose in a high contrast and empty world
and you start giving meaning to it: there is the foreground, but there are also mountains, there is distance
and you start to notice in the previous Global video like this one that by adding details the game is starting to look better than the other project
and we will see in the next videos more details, as I said I would have
and we are inserting and giving a very nice face to the game; Just for today, folks, keep following! thank you very much
