Skip to content

Commit 6ac2d9c

Browse files
Fix brick_breaker (#2352)
1 parent 4bb9845 commit 6ac2d9c

File tree

11 files changed

+129
-33
lines changed

11 files changed

+129
-33
lines changed

brick_breaker/codelab_rebuild.yaml

Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,22 @@ steps:
202202
size = Vector2(game.width, game.height);
203203
}
204204
}
205+
- name: Build iOS simulator bundle
206+
platforms: [macos]
207+
path: brick_breaker
208+
flutter: build ios --simulator
209+
- name: Build macOS app
210+
platforms: [macos]
211+
path: brick_breaker
212+
flutter: build macos
213+
- name: Build Linux app
214+
platforms: [linux]
215+
path: brick_breaker
216+
flutter: build linux
217+
- name: Build Windows app
218+
platforms: [windows]
219+
path: brick_breaker
220+
flutter: build windows
205221
- name: Copy step_04
206222
copydir:
207223
from: brick_breaker
@@ -305,6 +321,22 @@ steps:
305321
position += velocity * dt;
306322
}
307323
}
324+
- name: Build iOS simulator bundle
325+
platforms: [macos]
326+
path: brick_breaker
327+
flutter: build ios --simulator
328+
- name: Build macOS app
329+
platforms: [macos]
330+
path: brick_breaker
331+
flutter: build macos
332+
- name: Build Linux app
333+
platforms: [linux]
334+
path: brick_breaker
335+
flutter: build linux
336+
- name: Build Windows app
337+
platforms: [windows]
338+
path: brick_breaker
339+
flutter: build windows
308340
- name: Copy step_05
309341
copydir:
310342
from: brick_breaker
@@ -411,6 +443,22 @@ steps:
411443
412444
@override
413445
FutureOr<void> onLoad() async {
446+
- name: Build iOS simulator bundle
447+
platforms: [macos]
448+
path: brick_breaker
449+
flutter: build ios --simulator
450+
- name: Build macOS app
451+
platforms: [macos]
452+
path: brick_breaker
453+
flutter: build macos
454+
- name: Build Linux app
455+
platforms: [linux]
456+
path: brick_breaker
457+
flutter: build linux
458+
- name: Build Windows app
459+
platforms: [windows]
460+
path: brick_breaker
461+
flutter: build windows
414462
- name: Copy step_06
415463
copydir:
416464
from: brick_breaker
@@ -583,6 +631,22 @@ steps:
583631
);
584632
}
585633
}
634+
- name: Build iOS simulator bundle
635+
platforms: [macos]
636+
path: brick_breaker
637+
flutter: build ios --simulator
638+
- name: Build macOS app
639+
platforms: [macos]
640+
path: brick_breaker
641+
flutter: build macos
642+
- name: Build Linux app
643+
platforms: [linux]
644+
path: brick_breaker
645+
flutter: build linux
646+
- name: Build Windows app
647+
platforms: [windows]
648+
path: brick_breaker
649+
flutter: build windows
586650
- name: Copy step_07
587651
copydir:
588652
from: brick_breaker
@@ -762,6 +826,22 @@ steps:
762826
}
763827
}
764828
}
829+
- name: Build iOS simulator bundle
830+
platforms: [macos]
831+
path: brick_breaker
832+
flutter: build ios --simulator
833+
- name: Build macOS app
834+
platforms: [macos]
835+
path: brick_breaker
836+
flutter: build macos
837+
- name: Build Linux app
838+
platforms: [linux]
839+
path: brick_breaker
840+
flutter: build linux
841+
- name: Build Windows app
842+
platforms: [windows]
843+
path: brick_breaker
844+
flutter: build windows
765845
- name: Copy step_08
766846
copydir:
767847
from: brick_breaker
@@ -806,7 +886,7 @@ steps:
806886
+
807887
class BrickBreaker extends FlameGame
808888
- with HasCollisionDetection, KeyboardEvents {
809-
+ with HasCollisionDetection, KeyboardEvents, TapDetector {
889+
+ with HasCollisionDetection, KeyboardEvents, TapCallbacks {
810890
BrickBreaker()
811891
: super(
812892
camera: CameraComponent.withFixedResolution(
@@ -869,8 +949,8 @@ steps:
869949
870950
- debugMode = true;
871951
+ @override
872-
+ void onTap() {
873-
+ super.onTap();
952+
+ void onTapDown(TapDownEvent event) {
953+
+ super.onTapDown(event);
874954
+ startGame();
875955
}
876956
@@ -1039,6 +1119,22 @@ steps:
10391119
<application
10401120
android:label="brick_breaker"
10411121
android:name="${applicationName}"
1122+
- name: Build iOS simulator bundle
1123+
platforms: [macos]
1124+
path: brick_breaker
1125+
flutter: build ios --simulator
1126+
- name: Build macOS app
1127+
platforms: [macos]
1128+
path: brick_breaker
1129+
flutter: build macos
1130+
- name: Build Linux app
1131+
platforms: [linux]
1132+
path: brick_breaker
1133+
flutter: build linux
1134+
- name: Build Windows app
1135+
platforms: [windows]
1136+
path: brick_breaker
1137+
flutter: build windows
10421138
- name: Copy step_09
10431139
copydir:
10441140
from: brick_breaker

brick_breaker/step_03/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ publish_to: 'none'
44
version: 0.1.0
55

66
environment:
7-
sdk: ^3.9.0
7+
sdk: ^3.9.2
88

99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
flame: ^1.30.1
12+
flame: ^1.33.0
1313
flutter_animate: ^4.5.2
14-
google_fonts: ^6.3.0
14+
google_fonts: ^6.3.2
1515

1616
dev_dependencies:
1717
flutter_test:

brick_breaker/step_04/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ publish_to: 'none'
44
version: 0.1.0
55

66
environment:
7-
sdk: ^3.9.0
7+
sdk: ^3.9.2
88

99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
flame: ^1.30.1
12+
flame: ^1.33.0
1313
flutter_animate: ^4.5.2
14-
google_fonts: ^6.3.0
14+
google_fonts: ^6.3.2
1515

1616
dev_dependencies:
1717
flutter_test:

brick_breaker/step_05/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ publish_to: 'none'
44
version: 0.1.0
55

66
environment:
7-
sdk: ^3.9.0
7+
sdk: ^3.9.2
88

99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
flame: ^1.30.1
12+
flame: ^1.33.0
1313
flutter_animate: ^4.5.2
14-
google_fonts: ^6.3.0
14+
google_fonts: ^6.3.2
1515

1616
dev_dependencies:
1717
flutter_test:

brick_breaker/step_06/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ publish_to: 'none'
44
version: 0.1.0
55

66
environment:
7-
sdk: ^3.9.0
7+
sdk: ^3.9.2
88

99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
flame: ^1.30.1
12+
flame: ^1.33.0
1313
flutter_animate: ^4.5.2
14-
google_fonts: ^6.3.0
14+
google_fonts: ^6.3.2
1515

1616
dev_dependencies:
1717
flutter_test:

brick_breaker/step_07/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ publish_to: 'none'
44
version: 0.1.0
55

66
environment:
7-
sdk: ^3.9.0
7+
sdk: ^3.9.2
88

99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
flame: ^1.30.1
12+
flame: ^1.33.0
1313
flutter_animate: ^4.5.2
14-
google_fonts: ^6.3.0
14+
google_fonts: ^6.3.2
1515

1616
dev_dependencies:
1717
flutter_test:

brick_breaker/step_08/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ publish_to: 'none'
44
version: 0.1.0
55

66
environment:
7-
sdk: ^3.9.0
7+
sdk: ^3.9.2
88

99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
flame: ^1.30.1
12+
flame: ^1.33.0
1313
flutter_animate: ^4.5.2
14-
google_fonts: ^6.3.0
14+
google_fonts: ^6.3.2
1515

1616
dev_dependencies:
1717
flutter_test:

brick_breaker/step_09/lib/src/brick_breaker.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import 'config.dart';
1717
enum PlayState { welcome, playing, gameOver, won }
1818

1919
class BrickBreaker extends FlameGame
20-
with HasCollisionDetection, KeyboardEvents, TapDetector {
20+
with HasCollisionDetection, KeyboardEvents, TapCallbacks {
2121
BrickBreaker()
2222
: super(
2323
camera: CameraComponent.withFixedResolution(
@@ -100,8 +100,8 @@ class BrickBreaker extends FlameGame
100100
}
101101

102102
@override
103-
void onTap() {
104-
super.onTap();
103+
void onTapDown(TapDownEvent event) {
104+
super.onTapDown(event);
105105
startGame();
106106
}
107107

brick_breaker/step_09/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ publish_to: 'none'
44
version: 0.1.0
55

66
environment:
7-
sdk: ^3.9.0
7+
sdk: ^3.9.2
88

99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
flame: ^1.30.1
12+
flame: ^1.33.0
1313
flutter_animate: ^4.5.2
14-
google_fonts: ^6.3.0
14+
google_fonts: ^6.3.2
1515

1616
dev_dependencies:
1717
flutter_test:

brick_breaker/step_10/lib/src/brick_breaker.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import 'config.dart';
1717
enum PlayState { welcome, playing, gameOver, won }
1818

1919
class BrickBreaker extends FlameGame
20-
with HasCollisionDetection, KeyboardEvents, TapDetector {
20+
with HasCollisionDetection, KeyboardEvents, TapCallbacks {
2121
BrickBreaker()
2222
: super(
2323
camera: CameraComponent.withFixedResolution(
@@ -102,8 +102,8 @@ class BrickBreaker extends FlameGame
102102
}
103103

104104
@override
105-
void onTap() {
106-
super.onTap();
105+
void onTapDown(TapDownEvent event) {
106+
super.onTapDown(event);
107107
startGame();
108108
}
109109

0 commit comments

Comments
 (0)