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
220
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
360
SliverAppBarはなぜ変化する?~ Sliverを内側から理解する ~
umigishiaoi
0
150
My challenge to add Vision OS support in Flutter
umigishiaoi
0
110
Other Decks in Programming
See All in Programming
Java 25, Nuevas características
czelabueno
0
120
Deno Tunnel を使ってみた話
kamekyame
0
280
これならできる!個人開発のすゝめ
tinykitten
PRO
0
140
Pythonではじめるオープンデータ分析〜書籍の紹介と書籍で紹介しきれなかった事例の紹介〜
welliving
3
670
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
230
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.5k
TestingOsaka6_Ozono
o3
0
220
GISエンジニアから見たLINKSデータ
nokonoko1203
0
190
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
200
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
39
26k
Graviton と Nitro と私
maroon1st
0
150
Go コードベースの構成と AI コンテキスト定義
andpad
0
150
Featured
See All Featured
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
36
Writing Fast Ruby
sferik
630
62k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
210
New Earth Scene 8
popppiees
0
1.3k
The SEO identity crisis: Don't let AI make you average
varn
0
39
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.5k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
34
The agentic SEO stack - context over prompts
schlessera
0
570
Designing for humans not robots
tammielis
254
26k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
BBQ
matthewcrist
89
9.9k
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 とか活用してます ・ リポジトリ見てください!
ご清聴ありがとうございました!