Building a 2D Platformer Game with Godot. Part 3
<p>Previously, in <a href="https://carlosmv.hashnode.dev/building-a-2d-platformer-game-with-godot-part-1" rel="noopener ugc nofollow" target="_blank">part 1</a> of this series, we learned how to create a Godot project and add scenes and nodes. In <a href="https://carlosmv.hashnode.dev/building-a-2d-platformer-game-with-godot-part-2" rel="noopener ugc nofollow" target="_blank">part 2</a> of this series, we learned how to add animation to the player node.</p>
<p>In this article, we will add a background to our game.</p>
<p>This is going to be a very short article, just focusing on adding background to our game.</p>
<p>First, create a new scene, and name it “Background”.</p>
<p>We create a node, and select “ParallaxBackground”.</p>
<p><img alt="" src="https://miro.medium.com/v2/resize:fit:770/0*cMMnY0Y5580DZS7P" style="height:574px; width:700px" /></p>
<p>As the <a href="https://docs.godotengine.org/en/stable/classes/class_parallaxbackground.html" rel="noopener ugc nofollow" target="_blank">documentation</a> says, <code>ParallaxBackground</code> uses one or more <code>ParallaxLayer</code> child nodes to create a parallax effect. Each ParallaxLayer can move at a different speed using <code>ParallaxLayer.motion_offset</code>. This creates an illusion of depth in a 2D game. If not used with a Camera2D, you must manually calculate the scroll_offset.</p>
<p><a href="https://medium.com/@carlosmarcano2704/building-a-2d-platformer-game-with-godot-part-3-d97b04622b54"><strong>Website</strong></a></p>