introduce next shape
This commit is contained in:
@ -350,15 +350,16 @@ const orientation_t nextOrientation[5][4] = { // 5 = number of directions to mov
|
|||||||
};
|
};
|
||||||
|
|
||||||
stone_t stone;
|
stone_t stone;
|
||||||
|
shape_t nextShape;
|
||||||
|
|
||||||
void shapesInit() {
|
void shapesInit() {
|
||||||
stone.shape = e_ShapeInvalid;
|
stone.shape = e_ShapeInvalid;
|
||||||
|
nextShape = e_Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
void stoneCreate() {
|
void stoneCreate() {
|
||||||
uint16_t n = myRandGet();
|
stone.shape = nextShape;
|
||||||
uint8_t m = n % 7;
|
nextShape = ((shape_t[]){ e_I, e_O, e_T, e_Z, e_S, e_L, e_J })[myRandGet() % e_ShapeInvalid];
|
||||||
stone.shape = ((shape_t[]){ e_I, e_O, e_T, e_Z, e_S, e_L, e_J })[m];
|
|
||||||
stone.orientation = e_0;
|
stone.orientation = e_0;
|
||||||
stone.x = 5;
|
stone.x = 5;
|
||||||
stone.y = 0;
|
stone.y = 0;
|
||||||
|
Reference in New Issue
Block a user