04-27-2021 12:18 AM
Hello Everyone. I am trying to make a game using LabVIEW. I am stuck in, whenever I press LED even it is correct one, my state machine brings me to game over. Please if anybody have sometime check my event case in eventUI case structure. Also timeout is not functional. These are two problems I am stuck over the night. Help please.
I have attached my VI. I will be very thankful for any suggestion.
04-27-2021 07:26 AM
Your Boolean array in the shift register is empty. You cannot replace a value in an empty array. And any value you try to index out of the empty array will give you a FALSE, causing the "Game end" state to be called. I suggest you reset the array value in the "Game On" state to 4 FALSE values (use Initialize Array).
Other issues:
1. In the "Button" state you have an "equal to TRUE", which is just useless. Just wire the value through.
2. You need to keep the score in a Shift Register. It is currently using tunnels.
04-27-2021 10:31 AM
@crossrulz wrote:
Your Boolean array in the shift register is empty. You cannot replace a value in an empty array. And any value you try to index out of the empty array will give you a FALSE, causing the "Game end" state to be called. I suggest you reset the array value in the "Game On" state to 4 FALSE values (use Initialize Array).
Other issues:
1. In the "Button" state you have an "equal to TRUE", which is just useless. Just wire the value through.
2. You need to keep the score in a Shift Register. It is currently using tunnels.
I find these very handy. They pad the array as needed.