LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW LED game

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.

0 Kudos
Message 1 of 3
(949 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(895 Views)

@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.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 3
(876 Views)