Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Flutterだけでテトリス作ってみた
Search
Aoi Umigishi
February 29, 2024
Programming
0
210
Flutterだけでテトリス作ってみた
第2回Flutter Nightでの登壇資料です。
Aoi Umigishi
February 29, 2024
Tweet
Share
More Decks by Aoi Umigishi
See All by Aoi Umigishi
iOS 26にアップデートすると実機でのHot Reloadができない?
umigishiaoi
0
190
SliverAppBarはなぜ変化する?~ Sliverを内側から理解する ~
umigishiaoi
0
130
My challenge to add Vision OS support in Flutter
umigishiaoi
0
98
Other Decks in Programming
See All in Programming
go test -json そして testing.T.Attr / Kyoto.go #63
utgwkk
3
320
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
320
Performance for Conversion! 分散トレーシングでボトルネックを 特定せよ
inetand
0
5.3k
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
620
HTMLの品質ってなんだっけ? “HTMLクライテリア”の設計と実践
unachang113
4
3k
奥深くて厄介な「改行」と仲良くなる20分
oguemon
1
600
テストコードはもう書かない:JetBrains AI Assistantに委ねる非同期処理のテスト自動設計・生成
makun
0
580
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.3k
Swift Updates - Learn Languages 2025
koher
2
520
Design Foundational Data Engineering Observability
sucitw
3
210
速いWebフレームワークを作る
yusukebe
5
1.7k
1から理解するWeb Push
dora1998
7
2k
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
70
11k
Side Projects
sachag
455
43k
Practical Orchestrator
shlominoach
190
11k
GraphQLの誤解/rethinking-graphql
sonatard
72
11k
The Language of Interfaces
destraynor
161
25k
Site-Speed That Sticks
csswizardry
10
830
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
Gamification - CAS2011
davidbonilla
81
5.4k
Documentation Writing (for coders)
carmenintech
74
5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Transcript
F l u t t e r だ け で
テ ト リ ス 作 っ て み た F lu t t e r N i ght ���� 年 �� 月 �� 日 Aoi Umigishi
アジェンダ �. 自己紹介 �. 作成したテトリスの紹介 �. 作成ポイント a. テトリスのモデル化 b.
キーボード入力 c. 状態管理 �. まとめ
名前: Aoi Umigishi ( 東 優太 ) SNS 等: 職業:
フリーランスエンジニア (Flutter/TypeScript) 趣味:音楽、ゲーム、 etc ... 自己紹介
作成したテトリスの紹介
作成したテトリスの紹介 特徴: 特徴: �rd Party のパッケージを不使用!
作成ポイント ・テトリスのモデル化 [(false , 黒 ), (true , 紫 ),
(false , 黒 )], [(true , 紫 ), (true , 紫 ), (true , 紫 )] [ ] List<List<PanelModel>> ブロックを PanelModel でモデル化 ブロックを PanelModel でモデル化
作成ポイント ・テトリスのモデル化 移動のロジック 移動後の Block の位置に hasBlock = true のものがないか
チェック なければ移動を実行
作成ポイント ・テトリスのモデル化 移動のロジック 移動後の Block の位置に hasBlock = true のものがないか
チェック あれば移動しない
作成ポイント ・キーボード入力 https://docs.flutter.dev/ui/ interactivity/actions-and-shortcuts Shortcuts, Actions, Focus の � つの
Widget で実現
作成ポイント ・キーボード入力
作成ポイント ・状態管理 親 ゲーム画面 ボタン FieldState 課題 : ゲーム画面の状態をボタンから操作したい currentMino
作成ポイント ・状態管理 親 ゲーム画面 ボタン FieldState 課題 : ゲーム画面の状態をボタンから操作したい
作成ポイント ・状態管理 (StatefulWidget) ゲーム画面 ボタン FieldState 解決方法 : InheritedWidget の利用
TetrisController down (InheritedWidget) _InheritedTetris TetrisController.of(context).fieldState TetrisController.of(context).down
・Flutter だけでテトリスを作りました ・パッケージを使わずとも標準 API で色々できます まとめ ・でも、パッケージはやっぱり便利。感謝。 ・他にも Dart �
の List.indexed とか活用してます ・ リポジトリ見てください!
ご清聴ありがとうございました!