Dart Project - Building a Client Side Tetris Game - Part Two

preview_player
Показать описание
In this video, we finish the Tetris game by building out the game logic. Its a basic Tetris game that can be easily expanded. Fixed and re-uploaded added a small piece in the middle; sorry about the lower tone of voice.

Support the Channel and Join Patreon:

Dontate:
ETH: 0x03247265dd5242605bD2FA3c40fb3b70d9e3D685
Cardano: addr1q9auccwrr9ws8qdyv45f4qwsx76pfmld4zapks89sakq94ay0xmle73y0r8ruwd0zslls4eglf98lghru7ywv56cedysk7ftjt

Рекомендации по теме
Комментарии
Автор

Had to reupload this video due to some technical difficulties. While I was doing it, I figured I might as well add a section explaining the clear lines logic in a way that is more visual. Sorry about the change in my tone of voice; had to keep it down due to people sleeping in the other room. Hope you guys enjoy.

TensorProgramming
Автор

18:01 how did you assign (Element) to (board)?
(board) type is (CanvasElement) :)
I tried changing it to element and vise versa, but nothing worked
please help

zaynhamza
Автор

very clearly and useful tutorial, thanks.

曹文涛-hl
Автор

Tensor: I'm learning here, so sometimes my questions might be missing some very basic concepts. When you create the method validMove, you call the class Tile and the specific [something] "tile". Tile is the class with x, y values. tiles is the list of 4 two variable Tile entities. But the only reference to tile I see is when you define the method for rotateRight and that sufficient to then call it...or is the expression (Tile tile in currentBlock.tiles) defining that in and of itself.


I guess what I'm asking is, how does the compiler know what "tile" is? How does it know to evaluate each individual xy of the list tiles? Is it looking back at the first reference in the rotate method or are you defining that word, and could have said any word?

bryanhunsberger
Автор

Shoot, one more question! This last line in your handleKeyboard method: if (event.keyCode == 32) while (pieceMoving('down')) {} This does two things, right? 1. if space is hit, it loops the down method to drop the piece, but it is also the line that sends a down to pieceMoving according to the timer's updateGame, correct? So this line is two in one as well....allows for space bar to drop it all the way in a loop, and is keeping the piece dropping if nothing is pressed at all? I can sort of gather that this is happening, but I can't quite put together why this is happening. What's kind of voodoo is going on with that amazing "while" at the end?

bryanhunsberger
Автор

Tensor, one more question. In this line: if(!(pieceIsMoving = validMove()))....you are both evaluating for pieceIsMoving to NOT equal (!=) validMove as well as setting the value of pieceIsMoving to validMove in the same expression line, right? Both evaluating and setting the value at the same time?

bryanhunsberger
Автор

Great tutorial. But when you started the explanation of moving, rotating, limiting etc. I felt anxious and my imposter syndrome was back 😅

Didn't think it would be so complicated. Real world Flutter apps are so much more easier.

kirill
Автор

everytime i try to run webdev serve it shows webdev is not recognized as an internal pr external command please help

namanmakhija
Автор

Hello sir, thanks for the tutorial :)
I got some error on this line :
{
boardState[t.x][t.y] = 1; //this line
rowState[t.y]++;
});
t.y actually -1 so that the error become 'index out of range' since we defined some of the tiles inside block that has -1 on y-axis.

ps: sorry for my broken english

rasyidcode
Автор

Again: fantastic! Now playing Tetris... instead of learning... (please make a video on how to stop playing... ;-) ...)

RobertWildling