button and led game problem

Hey guys, I was trying to make a game of some kind with 14 leds, a push button and a potentiometer .
the idea of this project is like the game chicken invaders where i placed 7 green leds in a row and in front of them 7 red leds . a red led is supposed to light up and you can scroll between the green ones and when a red and a green one are opposite each other you can press the button and then the red led which was lit would turn off.I wrote the whole code myself and everything worked perfectly except for the button and firing part.Here is the code and the problem is in the part in the end which has all the if’s. The “if ((…=…)&&(…=…)){}” part means that if led no.1(for example)green and the button and led no.1 red are in the same state (high or low)the red led will turn off unless one has a different state.Please help me.

P.S:the code can be downloaded in the link below

fighter_second_trial.ino (2.59 KB)

Yusuf, please paste your code in a post using code tags so it looks like this. Many forum members use tablets and phones and cannot open a .ino file.

Sorry but i don't know how to do this "tag" thing so i will just paste the part with the problem normally:


P.S:(led1g1 and the other words which are similar are the digitalRead of the leds and val fire is the digital Read of the firing button

Sorry but i don't know how to do this "tag" thing

Then you should have read the "How to use this forum" post at the top of every part of the forum before you made your post.

i will just paste the part with the problem normally:

If you know so much you do not need our help! And that is not posting code "normally".