Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hacky checkpoints #14

Merged
merged 1 commit into from
Apr 30, 2017
Merged

Add hacky checkpoints #14

merged 1 commit into from
Apr 30, 2017

Conversation

JayFoxRox
Copy link
Owner

@JayFoxRox JayFoxRox commented Apr 21, 2017

To progress towards actual gameplay, this adds very basic checkpoints (hardcoded in main.cpp).
The checkpoints are labelled using text. However, they are only drawn and not actually used yet.
My idea for checkpoints is that they will extend to infinity (so for a closed circuit you'd need at least 3 individual checkpoints). They'll be placed along the raceline and race position can be calculated from the distance to the next checkpoint.

  • Text drawing has been turned into a lambda now.
  • The need for none-device specific coordinates is more and more apparent too: 800, 480 has been hardcoded again.

obligatory screenshot

Copy link
Contributor

@tulior tulior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments?

@@ -67,6 +68,25 @@ int main(int argc, char* argv[]) {
std::shared_ptr<Texture> texture = std::make_shared<Texture>("data/font/main");

std::shared_ptr<Text> text = std::make_shared<Text>("data/font/liberation_sans_bold_65");
auto drawText = [&](glm::vec2 position, std::string message) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making a lambda, why not move this into text.cpp?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it's beyond the scope of this PR. I'm still not sure what actual features the text renderer will require.
So instead of adding complexity now (which may be unnecessary / removed later), we can just keep this hacky temporarily and then decide what we really need, once and for all (when we have more logic implemented).


//FIXME: Do AR correction elsewhere
float aspectRatio = 800.0f / 450.0f;
glScalef(0.0005f, 0.0005f * aspectRatio, 1.0f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe glScalef's parameters should be parametrized as well?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but not now / in this PR.

@tulior
Copy link
Contributor

tulior commented Apr 26, 2017

Seems like an important step towards actual gameplay. LGTM.
I would benefit from the lambda having an extra parameter (scale), because I'll be working on an speedometer, and that requires a somewhat bigger looking font.

@JayFoxRox JayFoxRox merged commit 27e3e65 into master Apr 30, 2017
@JayFoxRox JayFoxRox deleted the checkpoints branch April 30, 2017 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants