39 lines
907 B
C++
39 lines
907 B
C++
#include "Components.hpp"
|
|
#include "Draw.hpp"
|
|
#include "Entities.hpp"
|
|
#include "Entity.hpp"
|
|
#include "Systems.hpp"
|
|
|
|
#include "raylib-cpp.hpp"
|
|
|
|
int main() {
|
|
raylib::Window window(700, 460, "Gravity Surfing");
|
|
window.SetState(FLAG_WINDOW_RESIZABLE);
|
|
window.SetTargetFPS(60);
|
|
|
|
std::vector<std::shared_ptr<Entity>> entities;
|
|
entities.reserve(20);
|
|
|
|
entities.push_back(CreateWorld());
|
|
entities.push_back(CreateGravityWell());
|
|
entities.push_back(CreateProbe());
|
|
entities.push_back(CreateHUD());
|
|
|
|
while (!window.ShouldClose()) {
|
|
float dt = window.GetFrameTime();
|
|
|
|
UpdateAllSystems(entities, dt);
|
|
|
|
window.BeginDrawing();
|
|
window.ClearBackground(raylib::Color(11, 15, 26, 255));
|
|
|
|
DrawSceneOutline();
|
|
|
|
raylib::DrawText("Gravity Surfing", 14, 12, 20, raylib::Color::RayWhite());
|
|
|
|
window.EndDrawing();
|
|
}
|
|
|
|
return 0;
|
|
}
|