Ten086 / IndepProject

Independent project - Tetris
1 stars 0 forks source link

collision? #5

Closed tluo5458 closed 6 years ago

tluo5458 commented 6 years ago

for some reason the checkCollision method randomly gives array index out of bounds exception of like 31 or 32 when i rotate piece even when it's a valid rotation

tluo5458 commented 6 years ago

seems like it only happens when you try to rotate in the first two ticks

tluo5458 commented 6 years ago

nvm it happened again like 4 ticks in

tluo5458 commented 6 years ago

ok i know why it's happening, just not sure it's because for some reason the center of rotation is not changing properly, it becomes like [24, 3] or some garbage like that so when you rotate it dies

tluo5458 commented 6 years ago

so it seems like it's an issue with timing sometimes if you time it right the height position doesn't reset so the y position of the center of rotation keeps on going down into the board o.O

tluo5458 commented 6 years ago

HOLY i figured it out it is a references problem it changes with respect to the piece, so if you get the same piece as you had before, the COR is still changed so it keeps on going down and dying time to fix

tluo5458 commented 6 years ago

fixed time to add SRS