Skip to content

docs: Klondike tutorial, part 4#1740

Merged
spydon merged 45 commits into
flame-engine:mainfrom
st-pasha:ps.klondike-4
Jun 27, 2022
Merged

docs: Klondike tutorial, part 4#1740
spydon merged 45 commits into
flame-engine:mainfrom
st-pasha:ps.klondike-4

Conversation

@st-pasha
Copy link
Copy Markdown
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
Copy Markdown
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!

Comment thread doc/tutorials/klondike/app/lib/step4/klondike_game.dart
Comment thread packages/flame/lib/src/experimental/world.dart
@spydon spydon requested a review from a team June 18, 2022 08:22
import 'package:flutter/widgets.dart';

import 'package:klondike/step3/klondike_game.dart';
import 'klondike_game.dart';
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread doc/tutorials/klondike/app/lib/step4/components/card.dart
Copy link
Copy Markdown
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