mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 14:05:45 +01:00
add losing when the next shape overlaps the current one (just a basic quit)
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "../../main.h"
|
||||||
#include "../../window/colour8.h"
|
#include "../../window/colour8.h"
|
||||||
#include "../game.h"
|
#include "../game.h"
|
||||||
#include "shapes.h"
|
#include "shapes.h"
|
||||||
@@ -114,6 +115,8 @@ void place_update(game_data* const game_data, InputData const move) {
|
|||||||
clear_rows(game_data->rows, &game_data->score); // clear the rows that have been completed
|
clear_rows(game_data->rows, &game_data->score); // clear the rows that have been completed
|
||||||
|
|
||||||
next_shape(game_data);
|
next_shape(game_data);
|
||||||
|
if (shape_intersects(game_data->rows, game_data->curr_idx, game_data->sel_x, game_data->sel_y))
|
||||||
|
stop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user