Jeopardy! Game Board Code Issues

Hello Forum, this is my first Arduino project not from a book and I am running into some trouble. My goal is to make an led system like a simplified version of the one on the game Jeopardy in which when a force sensor is pushed, its corresponding led lights up and then after 4 seconds the red led lights up indicating that time has run out. When one sensor is pushed, it shouldn’t let the other led come on. The problem is in the time between when the sensor is pressed and when its led turns on. It seems to take a while to light up, or it won’t light up at all.
Here’s the code and thanks!

//Building a Jeopardy! Buzzer System with LEDs
//If one sensor is pressed its LED lights up and blocks the other
//After 4 seconds the red LED turns on

int sensorAPin = 1;
int sensorBPin = 2;
int ledAPin = 10;
int ledBPin = 9;
int ledCPin = 11;
int val=0;
int val2=0;

void setup(){
  pinMode (ledAPin, OUTPUT); //LED is an OUTPUT
  pinMode (ledBPin, OUTPUT); //LED is an OUTPUT
  pinMode (ledCPin, OUTPUT); //LED is an OUTPUT

void loop(){
  val = analogRead (sensorAPin);
  val2 = analogRead (sensorBPin); 
 if (val>500 && val2<500){
    digitalWrite (ledAPin,HIGH);
    digitalWrite (ledBPin,LOW);
    digitalWrite (ledCPin, HIGH);

else if (val<500 && val2>500){
  digitalWrite (ledAPin,LOW);
  digitalWrite (ledBPin,HIGH);
  digitalWrite (ledCPin, HIGH);


Have you verified that 500 is the proper cutoff-value for your buttons?

I have tried it with a variety of different numbers but i figured that it would give me a result between 0-1023 so 500 was a safe number. Also i tried it with 1 instead of 500 and then the light goes on by itself. Might I have faulty touch sensors?

Might I have faulty touch sensors?

Possibly, but you don't say what they are or how they are wired. I'm guessing floating inputs.