• 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 25: Creating Menus When Levels Are Out

AnonyViet by AnonyViet
January 26, 2023
in Tips
0

In this part, I will show you how to create a menu when you finish playing a level and it will be able to move to the next level, play again and return to the Level Map menu.

Join the channel Telegram of the AnonyViet 👉 Link 👈

Copy Scene

Then instead of having to recreate it from scratch, you can duplicate a new scene from the scene pause menu.

[Tạo 2D Platformer Game với Godot]  Part 25: Creating Menus When Levels Are Out

You find the pause menu in the filesystem right click and click duplicate

[Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 16 is over

[Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 17 is over

I will rename it EndLevelMenu
[Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 18 is over

Then you delete the other nodes and leave them as shown, I changed the name NutTepTuc to LevelKeTiep

[Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 19 is over

Edit text in TieuDe
[Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 20 is over

You will clear the old script by pressing the button with the paper that has an x[Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 21 is over [Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 22 is over

Then create a new one.[Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 23 is over

Then 3 buttons, you disconnect because it is connecting to the old script.

[Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 24 is over

Then reconnect 3 new ones.

[Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 25 is over

Then Instance EndLevelMenu to Map.

Then you remember to hide the EndLevelMenu that belongs to the Control Node type.

Script

extends CanvasLayer



onready var level = get_parent().get_node("KhuVucDiChuyen")

func _on_NutLevelKeTiep_pressed():
    get_tree().paused = false
    get_tree().change_scene(level.LevelKeTiep)
    pass # Replace with function body.

func _on_NutChoiLai_pressed():
    get_tree().paused = false
    get_tree().reload_current_scene()
    print("choi lai")
    pass # Replace with function body.


func _on_NutVeMenu_pressed():
    get_tree().paused = false
    get_tree().change_scene("res://Scences/Map/LevelMap.tscn")
    pass # Replace with function body.

Here is the code of the EndLevelMenu script.

2 signals of the replay button and the menu will remain the same.

For LevelKeTiep to save time instead of having to manually set it up to see which level it moves to the next level, I’ll take it. At the KhuVucDi Chuyen node, I have created a variable called LevelKeTiep and it carries the data of the next scene, so I will call that variable instead of doing it manually.

[Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 26 is over

onready var level = get_parent().get_node("KhuVucDiChuyen"): is that I declare it and assign it with the parent node of the EndLevelMenu (as shown in the picture) and from that parent node I can access the KhuVucDi Chuyen node to get the data of the LevelKeTiep variable.

extends Area2D


export (String,FILE) var LevelKeTiep
onready var endlevelmenu = get_parent().get_node("EndLevelMenu")

func _on_KhuVucDiChuyen_body_entered(body):
    if body.name == "Player":
#		get_tree().change_scene(LevelKeTiep)
        endlevelmenu.get_node("EndLevelMenu").show()
        get_tree().paused = true

In the script of KhuVucDIChuyen, I changed it a little bit.

Here, instead of moving to the next level as usual, I will show it the EndLevelMenu and then stop the tree like in the pausemenu.

If you wonder why I get_node() 2 EndLevelMenu, then look at the picture below.[Tạo 2D Platformer Game với Godot]  Part 25: Create a Menu when Level 27 is over

I call 2 EndLevelMenu because I have 2 nodes :).

[Tạo 2D Platformer Game với Godot] Part 25: Creating Menus When Levels Are Out

And here are my results

Summary

In the next part, I will show you how to calculate the score after collecting the coins and when you go out of the LevelMap you will get the number of stars corresponding to the number of points.

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

Tags: creatingGameGodotLevelsMenusPartPlatformertạovới
Previous Post

Ninjutsu OS – An operating system for hackers based on Windows 10

Next Post

Godaddy’s 10-year domain registration guide for free with BIN

AnonyViet

AnonyViet

Related Posts

How to create a virtual Pet, a virtual character running around on the Desktop to relax
Tips

How to create a virtual Pet, a virtual character running around on the Desktop to relax

October 15, 2026
15 cách tăng tốc Windows 10 nhanh như gió
Tips

15 cách tăng tốc Windows 10 nhanh như gió

October 14, 2026
How to create Guest mode Shortcuts for Chrome and Edge
Tips

How to create Guest mode Shortcuts for Chrome and Edge

October 13, 2026
Test what breed of dog you are through 10 multiple choice questions
Tips

Test what breed of dog you are through 10 multiple choice questions

October 13, 2026
Fliqlo – Create digital clock screens on Windows and phones
Tips

Fliqlo – Create digital clock screens on Windows and phones

October 12, 2026
SynthID Detector: Genuine AI checking tool from Google
Tips

SynthID Detector: Genuine AI checking tool from Google

October 11, 2026
Next Post
Godaddy’s 10-year domain registration guide for free with BIN

Godaddy's 10-year domain registration guide for free with BIN

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted

Recent News

Instructions for receiving pension through VNeID without going to the ward

Instructions for receiving pension through VNeID without going to the ward

October 16, 2026
MBTI, Big Five, DISC or Holland: which personality test should you choose?

MBTI, Big Five, DISC or Holland: which personality test should you choose?

October 15, 2026
How to create a virtual Pet, a virtual character running around on the Desktop to relax

How to create a virtual Pet, a virtual character running around on the Desktop to relax

October 15, 2026
Record first, choose focus later: how to use 4K 60 fps Cinema mode on iPhone 18 Pro

Record first, choose focus later: how to use 4K 60 fps Cinema mode on iPhone 18 Pro

October 15, 2026
Instructions for receiving pension through VNeID without going to the ward

Instructions for receiving pension through VNeID without going to the ward

October 16, 2026
MBTI, Big Five, DISC or Holland: which personality test should you choose?

MBTI, Big Five, DISC or Holland: which personality test should you choose?

October 15, 2026
How to create a virtual Pet, a virtual character running around on the Desktop to relax

How to create a virtual Pet, a virtual character running around on the Desktop to relax

October 15, 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

Instructions for receiving pension through VNeID without going to the ward

Instructions for receiving pension through VNeID without going to the ward

October 16, 2026
MBTI, Big Five, DISC or Holland: which personality test should you choose?

MBTI, Big Five, DISC or Holland: which personality test should you choose?

October 15, 2026
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

say88 tỷ lệ kèo nhà cái kèo nhà cái 5 febet

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

say88 tỷ lệ kèo nhà cái kèo nhà cái 5 febet

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