DreamyK9 / Tetris-AI

2 stars 0 forks source link

No pieces spawn after modularizing #5

Open DreamyK9 opened 2 years ago

DreamyK9 commented 2 years ago

I tried turning the project structure into modules, which I was mostly successful with, but afterwards at least one nasty bug showed up. The pieces no longer spawn on the grid, and therefore the game overall doesn't progress.

It seems to have to do with activePiece.dropBuffer not updating and instead being NaN. Though I have no idea why.

I committed it to a new branch called modularize for now.

D4veDev commented 2 years ago

I fixed the Nan Error by simply initializing prev with value 0 in sketch.js.

D4veDev commented 2 years ago

I noticed a few things that have to be modified in order to make the modularization work.