• 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 tasks

AnonyViet by AnonyViet
May 17, 2024
in Tips
0

Continuing the series, today admin will continue part 7 which is moving between levels. It can be understood as moving back and forth to edit the sences. To learn about sence, please review Lesson 0 of Game programming series using Godot. As for the level, you guys play the game mmorp I understand it as a level, but in here it is a level. For example, if you play arngry bird after level 1, you will see that level 2 is the Level I mentioned here. Without further ado, let's get started.

Join the channel Telegram belong to AnonyViet 👉 Link 👈

Create New Sence

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

Move between levels

Okay like this:

Godot game programming through levels

Choose for yourself Other Nodes then press enter.Note select other node then press enter. enter Don't press anything else. It will give you a black button

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

And we'll need to save Node Player and Node Tilemap about in form .tscn to be able to put it into another sence without redoing it. And the same Node other like enemy.enemy good trap. trap

In the following way:

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

That means it will save the node you just selected as tscn and in this tscn format you can put your node in any sence without having to make 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 a folder tscn

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

In the folder you will see it 2 tscn Just saved it Tilemap and Player

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

And next is Import Tscn enter sence

Choose the one in the photo:

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

==>

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

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

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

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

You Instance 2 are Player and TileMap come in

And you'll see it's like old sences

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

Note: In the tilemap, you don't need to save it as tscn anymore, just create a tilemap node, then put the tileset in and design a new level, if you want this sence to be different.

Well, if you save this sence 2, let me call it level 2 and save it in a certain folder, mine is saved in the sence folder and Click Ctrl + S 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 tasks

Create Object Move Sence

To move between levels you will need to create a Sence Movement Object. First, you create your own node area2D live sence 1 Please

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

Add me 2 in Area 2D

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

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

And here is my photo:

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

After running the game

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

Next, create yourself a new script in Area2D

Then code as follows

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

Below:

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

get_overlapping_boides is a function that helps you check internal bodies collsion bodies enter collsion then it will do something.

for body in boides: for body in boides (just declared above) means 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. staticbody

if body.name == player: body.name means body and then get its name if equal to Player it will execute the command below. Well, “Player” is the name of your Player node. If your Node player is called any other name, you must replace it with “Player” for it to work.

get_tree.change_sence This is an order from Godot helps you move from sence This is luxury sence other also (next_world) is the function we declared above export. export.to make it easier to understand in section Export it will allow you to give 1 sen in then below if player. player touch the Object Move Sence then it will move Player arrive sence in section Export

Next, you can save it and go back to the view to see it Next World live Node Area2D right Place Script Variables.

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

Next, click on the folder next to next world and select the second scene

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

And it will be

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

Oh and we have to set collsion area2D Only then can the Player move to another level

I have set it up and it can be moved to another level

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

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

Set camera limit The right side is that amount and then adjust it 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 back the camera player limit will be moved.

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

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

Previous Post

Phone Pattern Blocker – App to block calls by number on iPhone

Next Post

Instructions for turning on Spatial Sound on Windows 11 to enjoy vivid sound

AnonyViet

AnonyViet

Related Posts

How to view web access history in the anonymous mode (Incognito) of Chrome
Tips

How to view web access history in the anonymous mode (Incognito) of Chrome

August 22, 2025
How to graft the peach branch based on electric poles, family cycling, uncle
Tips

How to graft the peach branch based on electric poles, family cycling, uncle

August 21, 2025
Unlock checkpoint 72h often have photos already but hang nick
Tips

Unlock checkpoint 72h often have photos already but hang nick

August 19, 2025
GIF image creation tips with high quality snipping tool
Tips

GIF image creation tips with high quality snipping tool

August 19, 2025
How to unlock Facebook to download your latest photos
Tips

How to unlock Facebook to download your latest photos

August 18, 2025
Instructions on how to format text on the Windows 11 notepad
Tips

Instructions on how to format text on the Windows 11 notepad

August 16, 2025
Next Post
Instructions for turning on Spatial Sound on Windows 11 to enjoy vivid sound

Instructions for turning on Spatial Sound on Windows 11 to enjoy vivid sound

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

How to view web access history in the anonymous mode (Incognito) of Chrome

How to view web access history in the anonymous mode (Incognito) of Chrome

August 22, 2025
How to automatically erase the web history after escaping to absolutely secure

How to automatically erase the web history after escaping to absolutely secure

August 22, 2025
Stainless steel flange price list at Asia Industry

Stainless steel flange price list at Asia Industry

August 21, 2025

Hướng Dẫn Đăng Nhập VN88

August 21, 2025
How to view web access history in the anonymous mode (Incognito) of Chrome

How to view web access history in the anonymous mode (Incognito) of Chrome

August 22, 2025
How to automatically erase the web history after escaping to absolutely secure

How to automatically erase the web history after escaping to absolutely secure

August 22, 2025
Stainless steel flange price list at Asia Industry

Stainless steel flange price list at Asia Industry

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

How to view web access history in the anonymous mode (Incognito) of Chrome

How to view web access history in the anonymous mode (Incognito) of Chrome

August 22, 2025
How to automatically erase the web history after escaping to absolutely secure

How to automatically erase the web history after escaping to absolutely secure

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