Kassia Posted February 13, 2017 Report Share Posted February 13, 2017 (edited) Hello. I try to make Tetris in LabView. I have problem with stop blocks on the last field and move blocks left and right. Does anyone have an idea how to solve it? Tetris4.vi Edited February 13, 2017 by Kassia Quote Link to comment
hooovahh Posted February 13, 2017 Report Share Posted February 13, 2017 Collision detection? Basically each block (normally only one falls at a time) will keep incrementing until a stop condition is seen. In your case it will be from the lowest block hitting the floor, but when the game goes on you could have any block hit another block forcing the whole 4 pixel object to stop moving down. You already have in a shift register where your objects are, so I'd suggest doing something like shift down, then count the number of Trues in the array. If they are less than the number of Trues before the shift then you know you shouldn't perform the shift and should revert back to where it was. There are examples on the web of doing tetris in LabVIEW and LabVIEW even used to ship with a version of it in the example finder. I can't seem to find it in modern versions but if I do I'll post it. Here is one discussion with several demos. https://forums.ni.com/t5/LabVIEW/Tetris-in-Labview/td-p/265716 Quote Link to comment
hooovahh Posted February 14, 2017 Report Share Posted February 14, 2017 I found the old Tetris demo that used to ship with LabVIEW. This example was pulled from LabVIEW 2011. I'm unsure what version stopped shipping it. InputDemo Tetris.llb Quote Link to comment
peizhirui Posted November 28, 2017 Report Share Posted November 28, 2017 I had done this before, please check if it can be a reference. Tetris 2013 V3.zip Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.