際際滷

際際滷Share a Scribd company logo
TETRIS!
In MATLAB
讌 豕
危 れ
Supporter : 襴
譟郁
螳
れ TETRIS MATLAB  襷
TETRIS
TETRIS BOARD
HIGHEST
SCORE BOARD
SCORE BOARD
INPUT PLAYER
NAME
GAME
START / PAUSE
BGM SETTING
/ BGM PLAY
GAME
RESET
DIFFICULTY SETTING
PROJECT NAME
蠍磯
TETRIS  RULE
 豐 7螳讌 block  ろ蟆 
 焔 block  豺語 企れ
 譬 覯殊朱 block 豺襯 蟾
  覦ロる block 
 覦レ企 るジ block  襷覃
蠏 block 覃豢螻 れ block  
れ
  譴 block朱 蟒 谿覃 蠏 譴
殊
  block 襷 譴 酔朱
Game Over 螳 
豢螳 FUNCTION
 BGM  , 覦覲 PLAY 蠍磯
 企  蠍磯
 /伎  蠍磯
 豕螻 蠍磯 /伎 
蠍磯
 る 觜 觜襯  
RESET 蠍磯
Coding  覲企 誤
TETRIS BOARD
SETTING ( 蠏碁る蠍),
axes れ
碁Μ 
覩碁Μ 蠏碁る
碁Μれ block 襯 
譯朱  襷.
Coding - 蟆
SET朱 TIMER 螳蟆 譟一
朱 企 れ
Coding  BGM(1)
譟伎 殊 audioread襦
曙伎
BGM PLAY 螳 螻旧 伎
 bgm.time  
BGM 覃 れ 伎
Timer襯 
襴 覲企ゼ audioplayer
Coding  BGM(2)
Play 螳 螻旧朱 螳語 蟆曙 襴螳  讌語襴襯 
螳覃 企 蟆所螳 覩襦 ceil 牛 襴狩 .
Coding Coding  BGM(3)
AudioPlayer れ願
螳螻, 覦覲 螳襷 覦蠑碁
企 BGM企朱  螳

SET朱 TIMER襯 れ 蠍
伎 timer audioplayer襯
覃豢一狩
 PLAY螻 る 蠏
 譬襭螻 覦 碁襯
Coding  GAME RULE
Handles.board.data   螳 覦覃 蠏碁殊朱 
handles.board.state 覲襯 朱
  襦  蠍磯レ   蟆
Coding  Game Rule
Board.data  覲企ゼ 蠏碁殊朱

Board.data  螳 磯 蟾
覲
(0 企 企 覲伎伎 螻,
6企 y企襦 蠏 豺語 碁
朱 豺)
Disp_board 襯 磯 襷朱  
 board.data 螳 覦覃 覲 貊襯 燕
   襯 ろる 蟆 .
CodingCoding  Game Rule
Board.rx board.ry 螳螳 讌
企 block  豺 x譬
 y譬, board.sb
board.block  蠍
Board.random 螻燕伎朱
 螳 覈 るジ 蟾 
襦 伎
  襷れ伎 Block
蟯 螳れ 伎 觚襦
殊, るジ讓, 襦 企
螻 る  讌
Board.state 螳 0 企 ろ  
襭 board.state 1襦 企
Coding  Game Rule
(貊螳 蠍瑚 覦覲旧企 朱
襷 螳語)
Board.ry螳 1 讀, block  襷 豺語  蟆曙一 
豺瑚骸 觜蟲襯  蟆曙 る螳 覩襦 if覓語 
Switch覓瑚骸 if 覓語 覦覲旧朱 
貊螳 蠍語伎讌襷, る襯 譴.
襴 :  螳 ろ , 螳 碁
 螳 襷  觚襦  block
る 企 覃豢螻 board.state螳 覲

螳 碁伎 襷 觚
襦 覲願鍵  a1,
a2, a3襯 
A1=2 A2=0
Board.state 螳 2願碓 
 覯殊  蟆曙 
  state螳 ろ螳ロ覃
れ 2覯, 覿螳ロ覃 3覯
朱 企
CodingCoding  Game Rule
CodingCoding  Game Rule
 觜蟲覓瑚骸, 觚襦 企 危エ覲願鍵  move_right 貊襯 螳語
一, 觚襦 るジ讓 覯曙 酔  ろ
覃 る螳 覩襦 if覓語 伎 蠏 蟆曙
ろ 讌 蟆 .
Board.sb(2)  block 企ゼ switch覓語 
 觜蟲
螳 觚襦  觜蟲 るジ讓曙 block  蟆曙一襷 ろ
襦 譟郁唄
CodingCoding  Game Rule
一 蠍一ヾ board.data  block 讌郁鍵  a ロ.
 data襯 j鍵  Board.data ル伎 Block 覲企ゼ 讌
.(觝)
X豺一危郁 覦  Block Board.data れ ロ.()
覦 Block 覲企 handles.board.rx(覲企 x豺 覲)襯 螳煙.
豐  STEP朱 Board 一危 螳煙 襭.
Coding  Game Rule
觚襦 襴蠍磯 襷谿螳讌襦 譟郁唄 焔暑る 4 STEP DATA 螳煙 螻
 蟇一.
Coding  Game Rule
Board.State 螳 3企 ろ
(觚襦 襦 企Μ蠍郁 襭覃  觚襦 襷
蠍  ろ)
襷  譴  谿覃 蠏 譴 豺襯
clr ロ.
襷 clr 0  蟆曙(  谿 譴
 蟆曙) 蠏 譴 讌郁 蠏 
譴れ  豺語 企Π. , 襯
100 豢螳.
襷 20覯讌 (襷 ) 譴 block 
る 蟆 譬襭蠍  state 2
襦 螳.
朱 譬襭る れ block
 襷り鍵  state 0朱 螳.
Coding  Game Rule
State 螳 2螳 蟇磯 reset
覯殊 襯企 蟆 譬
襭.
START 覯殊 string 
GAME OVER襦 覦螻,
覈 螳 豐蠍郁朱 覲
.
豕螻蠍磯螻 襯 觜蟲 豕螻蠍磯覲企 
朱 豕螻/伎企ゼ 螳煙.
Coding  Game Rule
Set_board 襷谿螳讌襦 
襯 襯 ろ蠍  譴
螳
蟆 Play譴 襷 
襦 豌伎 if覓語 蟇瑚 譟郁唄
朱 timer螳 螻  
ろ襦 譯殊.
 覯殊 block 襴蠍,
 覯殊 block 企Μ蠍,
譬 覯殊 螳螳 block 譬
磯 企る 覯殊企.
企 覈 block 企れり
 襷 覩瑚 朱襦
board.state螳 1 襷 
襦 .
Q&A
THE END
~螳~

More Related Content

Matlab tetris

  • 1. TETRIS! In MATLAB 讌 豕 危 れ Supporter : 襴 譟郁
  • 3. TETRIS BOARD HIGHEST SCORE BOARD SCORE BOARD INPUT PLAYER NAME GAME START / PAUSE BGM SETTING / BGM PLAY GAME RESET DIFFICULTY SETTING PROJECT NAME
  • 4. 蠍磯 TETRIS RULE 豐 7螳讌 block ろ蟆 焔 block 豺語 企れ 譬 覯殊朱 block 豺襯 蟾 覦ロる block 覦レ企 るジ block 襷覃 蠏 block 覃豢螻 れ block れ 譴 block朱 蟒 谿覃 蠏 譴 殊 block 襷 譴 酔朱 Game Over 螳 豢螳 FUNCTION BGM , 覦覲 PLAY 蠍磯 企 蠍磯 /伎 蠍磯 豕螻 蠍磯 /伎 蠍磯 る 觜 觜襯 RESET 蠍磯
  • 5. Coding 覲企 誤 TETRIS BOARD SETTING ( 蠏碁る蠍), axes れ 碁Μ 覩碁Μ 蠏碁る 碁Μれ block 襯 譯朱 襷.
  • 6. Coding - 蟆 SET朱 TIMER 螳蟆 譟一 朱 企 れ
  • 7. Coding BGM(1) 譟伎 殊 audioread襦 曙伎 BGM PLAY 螳 螻旧 伎 bgm.time BGM 覃 れ 伎 Timer襯 襴 覲企ゼ audioplayer
  • 8. Coding BGM(2) Play 螳 螻旧朱 螳語 蟆曙 襴螳 讌語襴襯 螳覃 企 蟆所螳 覩襦 ceil 牛 襴狩 .
  • 9. Coding Coding BGM(3) AudioPlayer れ願 螳螻, 覦覲 螳襷 覦蠑碁 企 BGM企朱 螳 SET朱 TIMER襯 れ 蠍 伎 timer audioplayer襯 覃豢一狩 PLAY螻 る 蠏 譬襭螻 覦 碁襯
  • 10. Coding GAME RULE Handles.board.data 螳 覦覃 蠏碁殊朱 handles.board.state 覲襯 朱 襦 蠍磯レ 蟆
  • 11. Coding Game Rule Board.data 覲企ゼ 蠏碁殊朱 Board.data 螳 磯 蟾 覲 (0 企 企 覲伎伎 螻, 6企 y企襦 蠏 豺語 碁 朱 豺) Disp_board 襯 磯 襷朱 board.data 螳 覦覃 覲 貊襯 燕 襯 ろる 蟆 .
  • 12. CodingCoding Game Rule Board.rx board.ry 螳螳 讌 企 block 豺 x譬 y譬, board.sb board.block 蠍 Board.random 螻燕伎朱 螳 覈 るジ 蟾 襦 伎 襷れ伎 Block 蟯 螳れ 伎 觚襦 殊, るジ讓, 襦 企 螻 る 讌 Board.state 螳 0 企 ろ 襭 board.state 1襦 企
  • 13. Coding Game Rule (貊螳 蠍瑚 覦覲旧企 朱 襷 螳語) Board.ry螳 1 讀, block 襷 豺語 蟆曙一 豺瑚骸 觜蟲襯 蟆曙 る螳 覩襦 if覓語 Switch覓瑚骸 if 覓語 覦覲旧朱 貊螳 蠍語伎讌襷, る襯 譴. 襴 : 螳 ろ , 螳 碁 螳 襷 觚襦 block る 企 覃豢螻 board.state螳 覲 螳 碁伎 襷 觚 襦 覲願鍵 a1, a2, a3襯 A1=2 A2=0 Board.state 螳 2願碓 覯殊 蟆曙 state螳 ろ螳ロ覃 れ 2覯, 覿螳ロ覃 3覯 朱 企
  • 15. CodingCoding Game Rule 觜蟲覓瑚骸, 觚襦 企 危エ覲願鍵 move_right 貊襯 螳語 一, 觚襦 るジ讓 覯曙 酔 ろ 覃 る螳 覩襦 if覓語 伎 蠏 蟆曙 ろ 讌 蟆 . Board.sb(2) block 企ゼ switch覓語 觜蟲 螳 觚襦 觜蟲 るジ讓曙 block 蟆曙一襷 ろ 襦 譟郁唄
  • 16. CodingCoding Game Rule 一 蠍一ヾ board.data block 讌郁鍵 a ロ. data襯 j鍵 Board.data ル伎 Block 覲企ゼ 讌 .(觝) X豺一危郁 覦 Block Board.data れ ロ.() 覦 Block 覲企 handles.board.rx(覲企 x豺 覲)襯 螳煙. 豐 STEP朱 Board 一危 螳煙 襭.
  • 17. Coding Game Rule 觚襦 襴蠍磯 襷谿螳讌襦 譟郁唄 焔暑る 4 STEP DATA 螳煙 螻 蟇一.
  • 18. Coding Game Rule Board.State 螳 3企 ろ (觚襦 襦 企Μ蠍郁 襭覃 觚襦 襷 蠍 ろ) 襷 譴 谿覃 蠏 譴 豺襯 clr ロ. 襷 clr 0 蟆曙( 谿 譴 蟆曙) 蠏 譴 讌郁 蠏 譴れ 豺語 企Π. , 襯 100 豢螳. 襷 20覯讌 (襷 ) 譴 block る 蟆 譬襭蠍 state 2 襦 螳. 朱 譬襭る れ block 襷り鍵 state 0朱 螳.
  • 19. Coding Game Rule State 螳 2螳 蟇磯 reset 覯殊 襯企 蟆 譬 襭. START 覯殊 string GAME OVER襦 覦螻, 覈 螳 豐蠍郁朱 覲 . 豕螻蠍磯螻 襯 觜蟲 豕螻蠍磯覲企 朱 豕螻/伎企ゼ 螳煙.
  • 20. Coding Game Rule Set_board 襷谿螳讌襦 襯 襯 ろ蠍 譴 螳 蟆 Play譴 襷 襦 豌伎 if覓語 蟇瑚 譟郁唄 朱 timer螳 螻 ろ襦 譯殊. 覯殊 block 襴蠍, 覯殊 block 企Μ蠍, 譬 覯殊 螳螳 block 譬 磯 企る 覯殊企. 企 覈 block 企れり 襷 覩瑚 朱襦 board.state螳 1 襷 襦 .
  • 21. Q&A