Parallax Backgrounds | Coding Geometry Dash in Java #19

preview_player
Показать описание
In this video, I go over how to build an effective parallax background. These parallax backgrounds will work with a variable timestep and loop infinitely, this requires a little bit of math to properly adjust the backgrounds as they tile across the x-axis.

---------------------------------------------------------------------

Рекомендации по теме
Комментарии
Автор

This Windows Defender popup is driving me crazy :D

oldchannel
Автор

I have to say, together with part 8 & 9, this is one of the worst in the series.
Here mainly because it overcomplicates:


One can just create a single sprite containing the image x times next to itself.
Then to move the Sprite, just take the camera’s x modulo with the original image-width.
Also Parallax should be made a GameObject.

No @Override draw() required, the sprite component handles it.
No lengthy setup in LevelScene required, only one ParallaxBg needed for each Ground and Bg.
No Z layering required (lol)
No speed attribute etc.

Of course the video and explanation were still helpful, but I really dislike the shown implementation.

somedump
visit shbcf.ru