• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

[Tạo 2D Platformer Game với Godot] Part 6: Adding Background

AnonyViet by AnonyViet
January 27, 2023
in Tips
0

In this section, I will show you how to add Background and adjust the camera to make it more reasonable and beautiful.

Join the channel Telegram of the AnonyViet 👉 Link 👈

Character error

Then in the previous part, I showed you how to rotate the character and some of you will have an error that when rotating the character, it will fall or jerk, here is how to fix it.[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background

You are getting the error that is because the character it is like this, because it is out of position.

[Tạo 2D Platformer Game với Godot]  Part 6: Adding a 25 . Background

You will have to reset the center position.

Then it won’t happen again.

Background

Download

In part 2, when I provided the link to download the tileset, it already included the background, if you delete it, you can download it again at the following link: Swamp 2D Tileset

Setting

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 26 [Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 27

You download and put the background image in Folder 2 Background into the folder Assets of the game.

Type 1

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 28You guys add yourself the ParallaxBackground node[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 29

Add a Sprite node that is a child of the Background node.

[Tạo 2D Platformer Game với Godot]  Part 6: Adding a 30 . Background

You select the Sprite button and then drag the background image file to the Texture.

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 31

You will be like this.

And you remember for yourself that the blue frame is the frame that the user can see.[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 32

I will drag the background to fit the green frame.

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 33

Then run the game you will see the background it has appeared and always moves with you.

Type 2

If you want the background not to move with you then do the following.

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 34

You create one more ParallaxLayer node and put the Sprite as a child of that node.

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 35

Then at the button ParallaxLayer -> Motion you will see the Mirroring section, then at x you adjust to 1000 for yourself.

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 36

After adjusting to 1000 you will see that there will be 1 more background appearing and I call this Infinity Background.

You design your level to where you set the Background it there.

Camera

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 37

I will also show you how to optimize the camera to look good, if you look at the picture above, it won’t look good at all.

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 38

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 39First, you have to see for yourself the coordinates that you want the camera to only move to by zooming in where you want to go and viewing in the coordinate bar.

Here on the left I want the maximum camera angle to be at coordinate 0, below it is 550, above it is 0 notes.

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 40

After I have the coordinates, I will go to Player -> Camera2D -> Limit and fill in the coordinates.[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 41

I will be like this after editing, it looks very good.

Camera by map

There will be different maps and each map’s camera you will have to limit differently, so if you adjust in Player, when in another map, this part will fail.

Therefore, I have this way so that you can adjust the camera limit according to each map.[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 42

You go to the map you want then select Player right click -> click Editable Children (allows you to edit the Instance node as a child node)

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 43

Then you find Camera2D and adjust it again.

Adjust the game when zooming in and out

When zooming in and out of the game according to the default settings, the game will not keep as default but it will be small[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 44

For example, this is when I zoom out.

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 45

And this is when zoomed out according to other settings.

It depends on the game you want to make and how you want it to be.

[Tạo 2D Platformer Game với Godot]  Part 6: Adding Background 46

To be like this, you go to Project Settings, find Display, select Window and adjust in Mode, Aspect it has many modes for you to explore.

Summary

So in this part, I showed you how to add a background and adjust the camera so that it is reasonable.

The article achieved: 5/5 – (100 votes)

Tags: AddingbackgroundGameGodotPartPlatformertạovới
Previous Post

How to Find the Location of Relatives and Friends Using Google Maps

Next Post

How to turn off WifiVinaphone on Internet Modem

AnonyViet

AnonyViet

Related Posts

Top 5 game programming languages ​​to learn now
Tips

Top 5 game programming languages ​​to learn now

June 8, 2025
[Godot Shooter] #2: Creating characters & shooting bullets
Tips

[Godot Shooter] #2: Creating characters & shooting bullets

June 7, 2025
What do you need to learn game programming? Is it difficult? How long does it take?
Tips

What do you need to learn game programming? Is it difficult? How long does it take?

June 6, 2025
Instructions for registering chatgpt team at $ 1
Tips

Instructions for registering chatgpt team at $ 1

June 5, 2025
How to engrave the right mouse menu error on Windows
Tips

How to engrave the right mouse menu error on Windows

June 5, 2025
How to create online meme photos is very easy with a few steps
Tips

How to create online meme photos is very easy with a few steps

June 5, 2025
Next Post
How to turn off WifiVinaphone on Internet Modem

How to turn off WifiVinaphone on Internet Modem

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

Top 5 game programming languages ​​to learn now

Top 5 game programming languages ​​to learn now

June 8, 2025
The iPhone list is updated with iOS 26

The iPhone list is updated with iOS 26

June 8, 2025
Discover the glowing effect next to the iPhone ios 18 screen

Discover the glowing effect next to the iPhone ios 18 screen

June 8, 2025
[Godot Shooter] #2: Creating characters & shooting bullets

[Godot Shooter] #2: Creating characters & shooting bullets

June 7, 2025
Top 5 game programming languages ​​to learn now

Top 5 game programming languages ​​to learn now

June 8, 2025
The iPhone list is updated with iOS 26

The iPhone list is updated with iOS 26

June 8, 2025
Discover the glowing effect next to the iPhone ios 18 screen

Discover the glowing effect next to the iPhone ios 18 screen

June 8, 2025
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

Top 5 game programming languages ​​to learn now

Top 5 game programming languages ​​to learn now

June 8, 2025
The iPhone list is updated with iOS 26

The iPhone list is updated with iOS 26

June 8, 2025
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí SHBET https://kubet88.yoga/ bj88

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí SHBET https://kubet88.yoga/ bj88

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply