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

docs: Klondike tutorial, part 4 #1740

Merged
merged 45 commits into from
Jun 27, 2022
Merged

Conversation

st-pasha
Copy link
Contributor

Description

This PR adds step 4 for the Klondike tutorial: "Gameplay".

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have read the Contributor Guide and followed the process outlined for submitting PRs.
  • [-] I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples.

Breaking Change

  • [-] Yes, this is a breaking change.
  • No, this is not a breaking change.

Related Issues

Closes #1678

@st-pasha st-pasha changed the title doc: Klondike tutorial, part 4 docs: Klondike tutorial, part 4 Jun 18, 2022
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

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

Good stuff!

packages/flame/lib/src/experimental/world.dart Outdated Show resolved Hide resolved
@spydon spydon requested a review from a team June 18, 2022 08:22
@@ -1,7 +1,7 @@
import 'package:flame/game.dart';
import 'package:flutter/widgets.dart';

import 'package:klondike/step3/klondike_game.dart';
import 'klondike_game.dart';
Copy link
Member

Choose a reason for hiding this comment

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

IMO, such change should be done on a different PR, this is a lint refactor that has nothing to do with the new step right?

Copy link
Member

Choose a reason for hiding this comment

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

Does it matter when it is docs? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It actually has something to do with the new step:
We want each step to be completely independent from all other steps, so that the user can look at the code of that step, and even copy that code, without having to do any adjustments. The relative imports allow to do just that: they hide the fact that this file is part of a "step3" (since there wouldn't be any steps in user's code as they try to follow the tutorial).

Without this change it's possible to accidentally import classes from wrong steps (esp. if relying on IDE to do auto-import for you), and then you'd be wondering why the changes that you make to some class have no effect...

Copy link
Member

Choose a reason for hiding this comment

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

Does it matter when it is docs? 🤔

It does because it make code review easier 😉

Copy link
Member

Choose a reason for hiding this comment

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

Without this change it's possible to accidentally import classes from wrong steps (esp. if relying on IDE to do auto-import for you), and then you'd be wondering why the changes that you make to some class have no effect...

got it, but still, once this was identified, you could have extracted into a separate PR. Either way no need to change now, but just something to think for future PRs.

Copy link
Member

@erickzanardo erickzanardo left a comment

Choose a reason for hiding this comment

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

Overall LGTM, nice job on this step, left just a couple of comments.

@spydon spydon enabled auto-merge (squash) June 27, 2022 20:26
@spydon spydon merged commit 02d0b71 into flame-engine:main Jun 27, 2022
@st-pasha st-pasha deleted the ps.klondike-4 branch June 27, 2022 20:38
@spydon spydon mentioned this pull request May 11, 2023
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.

Write step 4 of the Klondike tutorial
3 participants