Skip to content

Commit c9096fe

Browse files
true comments
1 parent e373192 commit c9096fe

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed
-512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

StackAttack/StackAttack/sketch_dec02a/sketch_dec02a.ino

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ public:
556556
}
557557
else if(_chosenOption == 2)
558558
{
559-
//Меняем сложность(скорость) от 0 до 3
559+
//Change difficult (0-3)
560560
if(digitalRead(RIGHT_pin)==LOW)
561561
if(difficulty == 3)
562562
difficulty = 0;
@@ -639,7 +639,7 @@ public:
639639
LCD.setPixel(size*j+_j,size*i+_i);
640640

641641
}
642-
642+
//rendering only player
643643
void Render()
644644
{
645645
for (int i = 0; i < rows; i++)
@@ -661,7 +661,7 @@ public:
661661
}
662662
}
663663

664-
664+
//randomaiser
665665
void block_rand()
666666
{
667667

@@ -670,15 +670,15 @@ public:
670670
}
671671

672672

673-
673+
//logic of dropping blocks and kiiling player by them
674674
bool Update()
675675
{
676676
if (UpdatePlayer())
677677
{
678678
// scenegrid[player]
679-
// ïðîâåðèòü, åñòü ëè ïîëíûé íèæíèé ðÿä, óáðàòü åãî, ñäâèíóòü ìàòðèöó íà ñòðîêó âíèç
679+
680680

681-
if (player.x - 1 == 0 || player.x - 1 == 1) // åñëè íà âåðõíèõ 2 ëèíèÿõ - ñðàçó ïðîèãðàë
681+
if (player.x - 1 == 0 || player.x - 1 == 1) // if player on top 2 lines he dies
682682
return false;
683683

684684
for (int i = rows - 2; i > -1; --i)
@@ -687,12 +687,12 @@ public:
687687
{
688688
if (sceneGrid[i][j] == '#')
689689
{
690-
if (sceneGrid[i + 1][j] == '*')
690+
if (sceneGrid[i + 1][j] == '*')//dropping blocks
691691
{
692692
sceneGrid[i][j] = '*';
693693
sceneGrid[i + 1][j] = '#';
694694
}
695-
if(sceneGrid[i+1][j] == sceneGrid[player.x-1][player.y])
695+
if(sceneGrid[i+1][j] == sceneGrid[player.x-1][player.y])//killing player
696696
{
697697
return false;
698698
}
@@ -704,6 +704,7 @@ public:
704704
return true;
705705
}
706706

707+
//checking and clear bottom line
707708
void ProcessBottomLine()
708709
{
709710
bool canDelete = true;

0 commit comments

Comments
 (0)