Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
durkisneer1 authored Nov 18, 2023
1 parent c56d6dc commit 0b30016
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img src="https://img.shields.io/badge/license-MIT-blue.svg">
<a href="https://app.codacy.com/gh/durkisneer1/DurkGame/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/17028e01d32f4441be4bd5e37edb94ce"/></a>
</p>
DurkGame is an extention of SDL2. There will be different object types to inherit from in the future such as `CharacterBody`s, `RigidBody`s, and `PhysicsBody`s. Eventually, I plan to also implement handy mathematical functions such as pathfinding and raycasting.
DurkGame is an extention of SDL2. There will be different object types to inherit from in the future such as `CharacterBody`s, `StaticBody`s, and `PhysicsBody`s. Eventually, I plan to also implement handy mathematical functions such as pathfinding and raycasting.

# Documentation
I don't have a documentation page yet, but I plan on making one soon.
Expand All @@ -13,30 +13,32 @@ In the very least, here is a basic window setup program using DurkGame:

const dk::math::Vector2 WIN_SIZE = { 800, 600 };

int main() {
dk::init();

dk::RenderWindow window(WIN_SIZE, "DurkGame App");
dk::time::Clock clock;

bool run = true;
while (run) {
float deltaTime = clock.tick(60) / 1000.0f;

for (const auto& event : window.getEvents()) {
switch (event.type) {
case SDL_QUIT:
run = false;
break;
}
}

window.fill({ 40, 40, 40 });
window.flip();
}

dk::quit();
return 0;
int main() {
dk::init();
dk::RenderWindow window(WIN_SIZE, "DurkGame App");
dk::time::Clock clock;

bool done = false;
while (!done) {
double deltaTime = clock.tick(60);

for (const auto& event : window.getEvents()) {
if (event.type == DK_QUIT) {
done = true;
} else if (event.type == DK_KEYDOWN) {
if (event.key.keysym.sym == DKK_ESCAPE) {
done = true;
}
}
}

window.fill({ 40, 40, 40 });
window.flip();
}

dk::quit();
return EXIT_SUCCESS;
}
```

Expand Down

0 comments on commit 0b30016

Please sign in to comment.