mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-12 02:19:49 +08:00
docs: Remove deprecated mixin from klondike tutorial (#2535)
It just removes a deprecated line that is in the tutorial for building a Klondike game. The final code does not have it and it is no longer necessary to have it in the KlondikeGame class.
This commit is contained in:
@@ -148,14 +148,8 @@ Now that the waste pile is ready, let's get back to the `StockPile`.
|
|||||||
The second item on our todo list is the first interactive functionality in the game: tap the stock
|
The second item on our todo list is the first interactive functionality in the game: tap the stock
|
||||||
pile to deal 3 cards onto the waste.
|
pile to deal 3 cards onto the waste.
|
||||||
|
|
||||||
Adding tap functionality to the components in Flame is quite simple: first, we add the mixin
|
Adding tap functionality to the components in Flame is quite simple: we just add the mixin
|
||||||
`HasTappableComponents` to our top-level game class:
|
`TapCallbacks` to the component that we want to be tappable:
|
||||||
|
|
||||||
```dart
|
|
||||||
class KlondikeGame extends FlameGame with HasTappableComponents { ... }
|
|
||||||
```
|
|
||||||
|
|
||||||
And second, we add the mixin `TapCallbacks` to the component that we want to be tappable:
|
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
class StockPile extends PositionComponent with TapCallbacks { ... }
|
class StockPile extends PositionComponent with TapCallbacks { ... }
|
||||||
|
|||||||
Reference in New Issue
Block a user