ソースを参照

Working on game templates

pull/367/head
raysan5 7年前
コミット
ba4b39a025
5個のファイルの変更31行の追加8行の削除
  1. +15
    -4
      templates/advance_game/advance_game.c
  2. バイナリ
      templates/advance_game/resources/ambient.ogg
  3. バイナリ
      templates/advance_game/resources/coin.wav
  4. バイナリ
      templates/advance_game/resources/raylib_logo.png
  5. +16
    -4
      templates/standard_game/standard_game.c

+ 15
- 4
templates/advance_game/advance_game.c ファイルの表示

@ -15,6 +15,10 @@
#include "raylib.h"
#include "screens/screens.h" // NOTE: Defines global variable: currentScreen
#if defined(PLATFORM_ANDROID)
#include "android_native_app_glue.h"
#endif
//----------------------------------------------------------------------------------
// Global Variables Definition (local to this module)
//----------------------------------------------------------------------------------
@ -36,16 +40,22 @@ void DrawTransition(void);
//----------------------------------------------------------------------------------
// Main entry point
//----------------------------------------------------------------------------------
#if defined(PLATFORM_ANDROID)
void android_main(struct android_app *app)
#else
int main(void)
#endif
{
// Initialization
//---------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
const char windowTitle[30] = "<game name goes here>";
InitWindow(screenWidth, screenHeight, windowTitle);
#if defined(PLATFORM_ANDROID)
InitWindow(screenWidth, screenHeight, app);
#else
InitWindow(screenWidth, screenHeight, "raylib template - standard game");
#endif
// TODO: Load global data here (assets that must be available in all screens, i.e. fonts)
// Setup and Init first screen
@ -141,8 +151,9 @@ int main(void)
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
#if !defined(PLATFORM_ANDROID)
return 0;
#endif
}
void TransitionToScreen(int screen)

バイナリ
templates/advance_game/resources/ambient.ogg ファイルの表示


バイナリ
templates/advance_game/resources/coin.wav ファイルの表示


バイナリ
templates/advance_game/resources/raylib_logo.png ファイルの表示

変更前 変更後
幅: 256  |  高さ: 256  |  サイズ: 3.7 KiB

+ 16
- 4
templates/standard_game/standard_game.c ファイルの表示

@ -15,18 +15,29 @@
#include "raylib.h"
#include "screens/screens.h" // NOTE: Defines currentScreen
#if defined(PLATFORM_ANDROID)
#include "android_native_app_glue.h"
#endif
//----------------------------------------------------------------------------------
// Main entry point
//----------------------------------------------------------------------------------
#if defined(PLATFORM_ANDROID)
void android_main(struct android_app *app)
#else
int main(void)
#endif
{
// Initialization
//---------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
const char windowTitle[30] = "<game name goes here>";
InitWindow(screenWidth, screenHeight, windowTitle);
#if defined(PLATFORM_ANDROID)
InitWindow(screenWidth, screenHeight, app);
#else
InitWindow(screenWidth, screenHeight, "raylib template - standard game");
#endif
// TODO: Load global data here (assets that must be available in all screens, i.e. fonts)
@ -139,6 +150,7 @@ int main(void)
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
#if !defined(PLATFORM_ANDROID)
return 0;
#endif
}

読み込み中…
キャンセル
保存