Tux_Vs_X_ENGINE/src/Main.c

67 lines
1.3 KiB
C
Raw Normal View History

2021-08-28 22:48:16 +00:00
#include "raylib.h"
2021-09-12 19:23:15 +00:00
2021-08-28 22:48:16 +00:00
#include "Controls.h"
#include "Debug.h"
2021-09-18 15:22:16 +00:00
#include "Copying.h"
2021-08-28 22:48:16 +00:00
// Globles
// Position Varaibles
float EnemyPos_x = 482.0f, EnemyPos_y = 62.0f;
float TuxPos_x = 32.0f, TuxPos_y = 62.0f;
2021-08-28 22:48:16 +00:00
// Setup Code
void Func_Setup()
2021-08-28 22:48:16 +00:00
{
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "Tux Vs Windows");
SetTargetFPS(60);
}
// GameLoop Code
void Func_MainGameLoop()
2021-08-28 22:48:16 +00:00
{
// Load Textures
Texture2D tux = LoadTexture("assets/tux.png");
Texture2D enemy = LoadTexture("assets/enemy.png");
Texture2D arctic = LoadTexture("assets/arctic.png");
// GameLoop
while (!WindowShouldClose()) {
2021-08-28 22:48:16 +00:00
Func_ShowPos();
Func_Controls();
BeginDrawing();
ClearBackground(RAYWHITE);
2021-09-18 15:22:16 +00:00
// Put the sprites and text on the screen
2021-08-28 22:48:16 +00:00
DrawTexture(arctic, 50, 0, RAYWHITE);
DrawTexture(tux, TuxPos_x, TuxPos_y, RAYWHITE);
DrawTexture(enemy, EnemyPos_x, EnemyPos_y, RAYWHITE);
2021-09-18 15:22:16 +00:00
DrawText("Tux Vs X ENGINE PROTOTYPE please read the LINCENSE", 50, 18, 20, BLACK);
2021-08-28 22:48:16 +00:00
EndDrawing();
}
// Unload Textures
UnloadTexture(tux);
UnloadTexture(enemy);
UnloadTexture(arctic);
}
int main()
{
Func_Setup();
Func_MainGameLoop();
CloseWindow();
2021-09-18 15:22:16 +00:00
Func_License();
2021-08-28 22:48:16 +00:00
return 0;
}