如果使用 Visual Studio 為 Windows 開發遊戲,可使用適用於 Visual Studio 的 Android Game Development Extension (AGDE),將 Android 新增為目標開發平台。進階遊戲開發人員可利用這個方法,指定已使用 Visual C++ 專案開發的遊戲。您可以使用 AGDE 執行以下作業:
如要為遊戲新增社群功能、查看遊戲過程統計資料,並在多種裝置提供跨平台遊戲過程,您可以使用 Google Play 遊戲服務。您可以在 Google Play 管理中心設定及管理 Play 遊戲服務。接著,您可以使用 Play 遊戲服務的 API 為 Android、C 和 Unity 新增更多功能。詳情請參閱「Play 遊戲服務總覽」。
使用圖形 API 進行開發
為達到最佳 2D 和 3D 圖形效能,Android 遊戲必須使用低階圖形 API 與 GPU 通訊。支援範圍最廣的 Android 遊戲開發選項包括:
OpenGL ES
Vulkan
OpenGL ES 或 Vulkan 必須使用 Android Game Development Kit (AGDK),以 C 或 C++ 開發遊戲。Android GPU Inspector (AGI) 圖形剖析工具僅支援這兩種圖形 API。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Game development basics\n\nThere are three basic components of your development environment that you\nmust decide on before you start developing an Android game.\nThese include:\n\n- Game engines\n- Integrated development environments (IDEs)\n- Graphics APIs\n\nDevelop with game engines\n-------------------------\n\nA *game engine* is a software framework that includes a set of libraries and\ntools for game development. Using a game engine lets you focus on game\ncontent and optimization, while easily implementing things like:\n\n- Graphics\n- Animation\n- Sound\n- Game loops\n- Input device support\n\nGame engines usually include an IDE and other tools for configuring features,\ndesigning, developing, compiling, and exporting your game to Android and other\nplatforms.\n\nTo work with a game engine, you can choose from among the following approaches:\n\n- Use an unmodified game engine (recommended)\n- Customize an existing game engine\n- Develop a new game engine\n\n### Use an unmodified game engine (recommended)\n\nWorking with an unmodified game engine is the simplest approach to developing\nAndroid games. To do so, you must choose a game engine that meets Android\ndevelopment requirements.\n\n#### Game engines you can use without modification\n\nHere are some existing game engines that support Android development:\n\n- **Unity**: commercial; uses the C# programming language.\n- **Godot**: open source; supports multiple programming languages including GDScript, C#, and C++.\n- **Defold**: open source; uses the Lua programming language.\n- **Unreal**: commercial; uses the Blueprint visual scripting system and C++. (Specializes in high-end 3D graphics)\n\nFor information about setting up and working with these engines, see\n[Using a game engine on Android](/games/engines/engines-overview).\n\nDevelop with IDEs\n-----------------\n\nThe IDE you use to develop Android games depends on the game engine you use and\nyour workflow. The most common game engines include a game editor for design and\ncode editing, which game developers typically use along with Android Studio.\n\n### Game editors\n\nA *game editor* often tightly integrates game design features with code editing.\nIn some cases these editors help designers complete development tasks\nwithout writing code.\n\nIf you are developing your first Android game, the simplest and best option is\nto use a game editor along with Android Studio, because game editors:\n\n- Provide UI and a toolset focused on game design.\n- Integrate asset design and code editing tasks.\n- Focus on the supported programming language.\n- Include modeling and rendering tools.\n\n### Android Studio\n\nAndroid Studio is the official IDE for developing Android apps. You should\ninstall it along with any other IDEs that you plan to use. With Android Studio,\nyou can:\n\n- Debug code written in C/C++, Java, or Kotlin.\n- Manage the Android SDK, which you must use to build Android games.\n- Build, test, profile, and optimize games.\n- Edit C/C++ code using the [Android NDK](/ndk).\n- Configure app packages and Google Play settings.\n\nFor more information, see [Android Studio](/studio).\n\n### Visual Studio\n\nIf you're developing your game on Windows using Visual Studio, you can add\nAndroid as a target using the Android Game Development Extension (AGDE) for\nVisual Studio. This option for advanced game developers targets games that are\nalready in development using a Visual C++ project. You can use AGDE to do the\nfollowing:\n\n- Use an existing Visual C++ project to create an Android game.\n- Debug and profile your game using Visual Studio.\n- Use distributed build systems such as Incredibuild or SN-DBS.\n\nFor more information, see [AGDE](/games/agde).\n\nDevelop with Google Play Games Services\n---------------------------------------\n\nTo add social features to your game, view gameplay statistics, and provide\ncross-platform gameplay across multiple devices, you can use Google Play Games Services.\nYou can set up and manage Play Games Services in the Google Play Console. You\ncan then add features using the Play Games Services APIs for Android, C, and\nUnity.\nFor more information, see [Play Games Services overview](/games/pgs/overview).\n\nDevelop with Graphics APIs\n--------------------------\n\nTo achieve the best 2D and 3D graphics performance, your Android game must use a\nlow-level graphics API to communicate with a GPU. The most widely supported\noptions for Android game development are:\n\n- OpenGL ES\n- Vulkan\n\nOpenGL ES or Vulkan are required to use the Android Games Development Kit (AGDK)\nto develop a game in C or C++. They are the only two graphics APIs\nsupported by the Android GPU Inspector (AGI) graphics profiling tool.\n\nFor information about the Android GPU Inspector, see\n[AGI](/agi)."]]