How to add smaller matrix into bigger matrix? (Tetris based idea)
Mostrar comentarios más antiguos
We are creating a Tetris game for fun! & so far have blocks block{1} = [1 1; 1 1]; block{2} = [1 1; 0 1; 0 1]; block{3} = [1 1; 1 0; 1 0]; block{4} = [0 1 1; 1 1 0]; block{5} = [1 1 0; 0 1 1]; block{6} = [1 1 1 1]; block{7} = [0 1 0; 1 1 1];
and they get randomly chosen, but we then need to put the block on our game board
tetris = zeros(18, 10); %Gameboard and dimensions
we've tried a few things and they aren't working yet, any thoughts or input would be awesome! Thanks so much!
2 comentarios
KSSV
el 30 de Mzo. de 2017
You want to add or place the block some where in the tetris?
Maddie Bredehoeft
el 30 de Mzo. de 2017
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Video games en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!