• 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 add sliders to Facebook Stories to easily rewind videos
Tips

How to add sliders to Facebook Stories to easily rewind videos

April 21, 2026
How to change the default font on Windows 10
Tips

How to change the default font on Windows 10

April 13, 2026
5 tips for using a Browser to replace an App (helps save RAM, time and money)
Tips

5 tips for using a Browser to replace an App (helps save RAM, time and money)

April 13, 2026
How to make funny MeMe photos without Photoshop within 10 seconds
Tips

How to make funny MeMe photos without Photoshop within 10 seconds

April 11, 2026
How to quickly design your own Logo without Photoshop
Tips

How to quickly design your own Logo without Photoshop

April 10, 2026
How to convert Website into App on Windows
Tips

How to convert Website into App on Windows

April 9, 2026
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

Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

April 30, 2026
How to get 2 months of Super Duolingo for free worth 300k

How to get 2 months of Super Duolingo for free worth 300k

April 30, 2026
How to create a Face Sticker Collection using ChatGPT

How to create a Face Sticker Collection using ChatGPT

April 29, 2026
How to install the cute Bongo Cat mouse pointer for Windows

How to install the cute Bongo Cat mouse pointer for Windows

April 29, 2026
Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

April 30, 2026
How to get 2 months of Super Duolingo for free worth 300k

How to get 2 months of Super Duolingo for free worth 300k

April 30, 2026
How to create a Face Sticker Collection using ChatGPT

How to create a Face Sticker Collection using ChatGPT

April 29, 2026
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

Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

April 30, 2026
How to get 2 months of Super Duolingo for free worth 300k

How to get 2 months of Super Duolingo for free worth 300k

April 30, 2026
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

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