Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

Tworzenie nowego projektu

W tej krótkiej części utworzymy i uporządkujemy projekt.

Uruchom Godot'a i utwórz nowy projekt.

../../_images/new-project-button.webp

Podczas tworzenia nowego projekt wystarczy, że podasz poprawną Ścieżkę do projektu. Na razie pozostałe ustawienia możesz zostawić domyślne.

Pobierz dodge_the_creeps_2d_assets.zip. Archiwum to zawiera pliki graficzne i dźwiękowe, których będziesz używać do tworzenia gry. Rozpakuj archiwum i przenieś katalogi art/ and fonts/ do katalogu z projektem.

Twój folder projektu powinien wyglądać tak jak ten.

../../_images/folder-content.webp

This game is designed for portrait mode, so we need to adjust the size of the game window. Click on Project -> Project Settings to open the project settings window, in the left column open the Display -> Window tab. There, set "Viewport Width" to 480 and "Viewport Height" to 720.

../../_images/setting-project-width-and-height.webp

Również w tej sekcji, przy opcjach Rozciągnij ustaw Tryb na canvas_items i Aspekt na keep (zachowaj). Zapewni nam to, że gra będzie prawidłowo skalować się na ekranach o różnych rozmiarach.

../../_images/setting-stretch-mode.webp

Organizacja projektu

W tym projekcie utworzymy 3 niezależne sceny: Player, Mob oraz HUD, które połączymy ze sobą w głównej scenie gry Main.

In a larger project, it might be useful to create folders to hold the various scenes and their scripts, but for this relatively small game, you can save your scenes and scripts in the project's root folder, identified by res://. You can see your project folders in the FileSystem dock in the lower left corner:

../../_images/filesystem_dock.webp

With the project in place, we're ready to design the player scene in the next lesson.