You are reading a single comment by @Owen and its replies. Click here to read the full conversation.
  • I'm coding Tetris. The code below is unfinished and still very rough around the edges with lots of improvements to be made. Here is what I've done so far.

    1. Added all block types and their rotations
    2. Block fall and can be moved/rotated (Use blockOp.left() blockOp.right() blockOp.rotate() blockOp.down() )
    3. Wall and floor collision detection
    4. All blocks are the same colour but want to add full RGB later

    The next part I'm working on is storing the fallen blocks in an Array so I can render them on each frame and then detect when other falling blocks need to settle on top of them.
    Here is a link to see the full code. The output is a 16x8 RGB-123 LED Matrix (the code should run fine without connecting anything) Line 191 logs the stored fallen blocks array when I then want to loop for rendering and collision detection but it's is very slow.
    http://jsfiddle.net/t0ucb1yt/1/

About

Avatar for Owen @Owen started