suchja / awesome-qt-snake

A portfolio and learning project show casing my OOP, OOAD, Qt6 and C++ skills.
The Unlicense
0 stars 0 forks source link

As a player, I want to easily start the game so that I can begin playing immediately. #3

Closed suchja closed 3 months ago

suchja commented 3 months ago

Notes

Open Issues

Acceptance criteria

suchja commented 3 months ago

Adding this to milestone 0.1 as it relates to the core game.

suchja commented 3 months ago

ChangeLog: Moved #5 from here into a separate user story as it seems to me that it all together gets to large for one user story.

suchja commented 3 months ago

ChangeLog: Added acceptance criteria for letting snake "cross" the game board and added that the hint how to start the game should disappear.

suchja commented 3 months ago

Testing

This morning I made up my mind about TDD (see here. So now it is time to try TDD "the right way").

That means I try to use the following list of tests to guide the development.

List of Tests for this behavior

ChangeLog

Open Issues / Tasks

Based on the wonderful book Test Driven Development by example (written by Kent Beck), I'll also track todos and open issues as they arise in order to keep moving forward and not get distracted.

suchja commented 3 months ago

Starting with test Pressing any other key (except arrow) does nothing to the snake or the game

Then I do have some logic here that I'll not test. Not sure how to integrate things like that into TDD. Anyhow, the MainWindow will get an EventFilter, which calls the newly implemented method in GameViewModel.

suchja commented 3 months ago

Somehow I have difficulties with the next test Pressing any arrow key should set the moving direction of the snake accordingly. This is somehow difficult to test AND it seems to me that it already has some kind of implementation decision in it. It talks about a moving direction. Although the snake obviously moves into a certain direction on the game board, the term moving direction to implies a certain state of a Snake object.

Wouldn't it make more sense to say Pressing any arrow key should move the snake's head into the according direction with its next move? This brings us to the following questions:

So I would argue that the real test required here is Pressing any arrow key will move the snake towards the implied direction with its next move. This would give me the following direction:

suchja commented 3 months ago

So next stop is:

Snake (head and body) move one tile every 250 ms

Retrospective:

suchja commented 3 months ago

Next step is:

Snake head appears on the contrary side of the game board, if it leaves the game board on one side

suchja commented 3 months ago

Final step is to update the user message!

suchja commented 3 months ago

Copied open todos/issues from this comment to #9

As all acceptance criteria are met and todos are stored, this user story will be closed now.