• 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

[Lập Trình Game] Lesson 7: Move between levels when completing a mission

AnonyViet by AnonyViet
February 2, 2023
in Tips
0

Continuing the series, today ad will continue part 7 which is moving between levels. Can be understood as moving back and forth to edit the senses. To learn about sence, please review from Lesson 0 of Game programming series with Godot. As for the level, do you guys play the game? mmorp then understand it is a level but in this it is a game screen. For example, if you play argry bird after stage 1, you will see that stage 2 is the Level I mentioned here. Without further ado, let’s get started.

Join the channel Telegram of the AnonyViet 👉 Link 👈

Create New Sense

The first step is to create a new sense for yourself with the button “+” next to the sence tab World

Move between levels

Okay like this:

programming godot game through level

Choose for yourself Other Node then press enter.Note select other node then press enter don’t press anything else. It will give you the black button

[Lập Trình Game]  Lesson 7: Move between levels when completing quest 22

And we’ll need to save Node Player and Node Tilemap about as .tscn to be able to put it into another sence without redoing it. And the like Node other like enemy nice trap

By the following way:

You right click on Node Player And Node Tilemap Choose for yourself Save Branch As Sense

That means it will save the node you just selected as tscn and in this tscn you can put your node in any sence without doing another one.

Move between levels when completing missions

You can leave it anywhere. But remember to create a folder containing files like this for compactness.

Here I will save it in the folder tscn

[Lập Trình Game]  Lesson 7: Move between levels when completing quest 23

In the folder you will see there 2 tscn just saved as Tilemap and Player

[Lập Trình Game]  Lesson 7: Move between levels when completing task 24

And next is Import Tscn enter sense

Choose the one in the picture:

[Lập Trình Game]  Lesson 7: Move between levels when completing the mission 25

==>

[Lập Trình Game]  Lesson 7: Move between levels when completing missions 26

And here you will see there are 2-4 node It depends on your tscn. Mine has 3:

  • 1 is Player.
  • 2 is TileMap.
  • 3 Is Level 1 is World

[Lập Trình Game]  Lesson 7: Moving between levels when completing a mission 27

You guys Instance 2 is Player and TileMap come in

And you’ll see it’s like old sense

[Lập Trình Game]  Lesson 7: Move between levels when completing quest 28

Note: In tilemap you may not need to save it as tscn anymore, just create a tilemap node and then enter the tileset and design a new level, if you want this sence to be different

Well, you guys like to save this sence 2 for yourself as level 2 and save it in a certain folder, mine is in the sence folder and Click Ctrl + WILL to save

And below is my level 2. Next we will create an object that moves between levels

[Lập Trình Game]  Lesson 7: Move between levels when completing quests 29

Creating Sense Move Object

To move between levels you will need to create a Move Sense Object. First, you create your own node area2D live sense 1 Please

[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 30

Add me 2 in Area 2D

[Lập Trình Game]  Lesson 7: Move between levels when completing quest 31

In the Sprite section, you put your photos in and you can find them online

And here is my picture:

[Lập Trình Game]  Lesson 7: Move between levels when completing mission 32

After running the game

[Lập Trình Game]  Lesson 7: Move between levels when completing quest 33

Next, you create yourself a new script in Area2D

Then the code is as follows

[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 34

Here below:

Part export(String,FILE,"*.tscn") var next_world this is the part it will take this out of the node’s settings and you can put tscn in there for it to point to

get_overlapping_boides is a function that helps you check the bodies inside collection bodies enter collsion it will do something.

for body in boides: for body in boides (just declared above) means that if a body is inside the boides it will execute the if statement below. this body is a command of this node, the body here is kinematicbody and staticbody

if body.name == player: body.name ie body and then get its name if by Player it will execute the command below. Well, the “Player” is the name of your Player node. If your Node player has any name, you must replace it with “Player” to be effective.

get_tree.change_sence this is an order of Godot help you move from sense this is sense other (next_world) is the function we declared above export.speak for easy understanding in Export it will allow you to give 1 sense Go in and then below if player touch the Object Move Sense then it will move Player arrive sense in the section Export

Next, you save it and return to the sence, you will see there Next World live Node Area2D Right side of the Place Script Variables.

[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 35

Next, you click on the folder next to next world and choose the second sence

[Lập Trình Game]  Lesson 7: Move between levels when completing mission 36

And it will be

[Lập Trình Game]  Lesson 7: Move between levels when completing the mission 37

Ah and we have to set collection for area2D Then the Player can move to another level

I have set it up and it can move to another level

[Lập Trình Game]  Lesson 7: Move between levels when completing mission 38

And if you want better, you can do the following:

Set limit camera How much is it on the right, then adjust collsion of the sprite area2d behind the camera limit. When the camera reaches the number you set it will no longer move and after you move behind the limit camera player will be moved.

[Lập Trình Game]  Lesson 7: Move between levels when completing mission 39

[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 40

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

Tags: completingGamelậpLessonLevelsmissionMovetrình
Previous Post

Download WonderFox HD Video Converter Factory Pro v17.1

Next Post

Download Quick Batch File Compiler 4.3 – Convert .bat extension to .exe

AnonyViet

AnonyViet

Related Posts

4 ways to fix bluetooth connectivity on Windows 11
Tips

4 ways to fix bluetooth connectivity on Windows 11

August 8, 2025
How to know the computer is tracked and processed by Keylogger
Tips

How to know the computer is tracked and processed by Keylogger

August 7, 2025
Opal: Create applications who do not need to write code
Tips

Opal: Create applications who do not need to write code

August 3, 2025
How to activate a new Start menu on Windows 11
Tips

How to activate a new Start menu on Windows 11

July 29, 2025
Intellgpt: AI tool for osint and data science
Tips

Intellgpt: AI tool for osint and data science

July 28, 2025
How to create Google Ai Pro 12 months free with Indian student account
Tips

How to create Google Ai Pro 12 months free with Indian student account

July 27, 2025
Next Post
Download Quick Batch File Compiler 4.3 – Convert .bat extension to .exe

Download Quick Batch File Compiler 4.3 - Convert .bat extension to .exe

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

Online driving exam preparation: Support theory and practice

Online driving exam preparation: Support theory and practice

August 15, 2025
How to add application to your favorite bar

How to add application to your favorite bar

August 14, 2025
Wowhay.com – The door opens the world of modern knowledge and network culture

Wowhay.com – The door opens the world of modern knowledge and network culture

August 13, 2025
Instructions on how to fix Screen Time Limited Reached on RoBlox

Instructions on how to fix Screen Time Limited Reached on RoBlox

August 13, 2025
Online driving exam preparation: Support theory and practice

Online driving exam preparation: Support theory and practice

August 15, 2025
How to add application to your favorite bar

How to add application to your favorite bar

August 14, 2025
Wowhay.com – The door opens the world of modern knowledge and network culture

Wowhay.com – The door opens the world of modern knowledge and network culture

August 13, 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

Online driving exam preparation: Support theory and practice

Online driving exam preparation: Support theory and practice

August 15, 2025
How to add application to your favorite bar

How to add application to your favorite bar

August 14, 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í mm88 8XBET mm88 trang chủ new88

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í mm88 8XBET mm88 trang chủ new88

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