Noob need help

Ok, this is my first project ever and im doing with my 10 year old son. I thought it would get him off of the xbox for a little while and taught him to solder and about some simple circuits but having some trouble programming it. I have multiple LED's going in the pattern that he wants, but would like for them to come on when a PIR motion sensor(HC-SR501) is tripped. I have found multiple codes online but they all just turn on one led and I have a 14. I have tried multiple times to insert various code, but just keep getting errors. Here is my code so far.

int pin22 = 22;
int pin24 = 24;
int pin26 = 26;
int pin28 = 28;
int pin30 = 30;
int pin32 = 32;
int pin34 = 34;
int pin36 = 36;
int pin38 = 38;
int pin40 = 40;
int pin42 = 42;
int pin44 = 44;
int pin46 = 46;
int pin48 = 48;

int timer = 30;

void setup(){
  
  pinMode(pin22, OUTPUT);
  pinMode(pin24, OUTPUT);
  pinMode(pin26, OUTPUT);
  pinMode(pin28, OUTPUT);
  pinMode(pin30, OUTPUT);
  pinMode(pin32, OUTPUT);
  pinMode(pin34, OUTPUT);
  pinMode(pin36, OUTPUT);
  pinMode(pin38, OUTPUT);
  pinMode(pin40, OUTPUT);
  pinMode(pin42, OUTPUT);
  pinMode(pin44, OUTPUT);
  pinMode(pin46, OUTPUT);
  pinMode(pin48, OUTPUT);
}

void loop() {
  
   digitalWrite(pin22, HIGH);
   delay(timer);
   digitalWrite(pin22, LOW);
   delay(timer);

   digitalWrite(pin24, HIGH);
   delay(timer);
   digitalWrite(pin24, LOW);
   delay(timer);

   digitalWrite(pin26, HIGH);
   delay(timer);
   digitalWrite(pin26, LOW);
   delay(timer);

   digitalWrite(pin28, HIGH);
   delay(timer);
   digitalWrite(pin28, LOW);
   delay(timer);

   digitalWrite(pin30, HIGH);
   delay(timer);
   digitalWrite(pin30, LOW);
   delay(timer);
   
   digitalWrite(pin32, HIGH);
   delay(timer);
   digitalWrite(pin32, LOW);
   delay(timer);
   
   digitalWrite(pin34, HIGH);
   delay(timer);
   digitalWrite(pin34, LOW);
   delay(timer);
   
   digitalWrite(pin36, HIGH);
   delay(timer);
   digitalWrite(pin36, LOW);
   delay(timer);
   
   digitalWrite(pin38, HIGH);
   delay(timer);
   digitalWrite(pin38, LOW);
   delay(timer);
   
   digitalWrite(pin40, HIGH);
   delay(timer);
   digitalWrite(pin40, LOW);
   delay(timer);
   
   digitalWrite(pin42, HIGH);
   delay(timer);
   digitalWrite(pin42, LOW);
   delay(timer);
   
   digitalWrite(pin44, HIGH);
   delay(timer);
   digitalWrite(pin44, LOW);
   delay(timer);
   
   digitalWrite(pin46, HIGH);
   delay(timer);
   digitalWrite(pin46, LOW);
   delay(timer);
   
   digitalWrite(pin48, HIGH);
   delay(timer);
   digitalWrite(pin48, LOW);
   delay(timer);

   digitalWrite(pin46, HIGH);
   delay(timer);
   digitalWrite(pin46, LOW);
   delay(timer);
   
   digitalWrite(pin44, HIGH);
   delay(timer);
   digitalWrite(pin44, LOW);
   delay(timer);
   
   digitalWrite(pin42, HIGH);
   delay(timer);
   digitalWrite(pin42, LOW);
   delay(timer);
   
   digitalWrite(pin40, HIGH);
   delay(timer);
   digitalWrite(pin40, LOW);
   delay(timer);
   
   digitalWrite(pin38, HIGH);
   delay(timer);
   digitalWrite(pin38, LOW);
   delay(timer);
   
   digitalWrite(pin36, HIGH);
   delay(timer);
   digitalWrite(pin36, LOW);
   delay(timer);
   
   digitalWrite(pin34, HIGH);
   delay(timer);
   digitalWrite(pin34, LOW);
   delay(timer);
   
   digitalWrite(pin32, HIGH);
   delay(timer);
   digitalWrite(pin32, LOW);
   delay(timer);
   
   digitalWrite(pin30, HIGH);
   delay(timer);
   digitalWrite(pin30, LOW);
   delay(timer);

   digitalWrite(pin28, HIGH);
   delay(timer);
   digitalWrite(pin28, LOW);
   delay(timer);

   digitalWrite(pin26, HIGH);
   delay(timer);
   digitalWrite(pin26, LOW);
   delay(timer);

   digitalWrite(pin24, HIGH);
   delay(timer);
   digitalWrite(pin24, LOW);
   delay(timer);
   
   digitalWrite(pin22, HIGH);
   delay(timer);
   digitalWrite(pin22, LOW);
   delay(timer);
   

}

Any help would be greatly appreciated.

I forgot to mention im using a arduino Mega 2560

Hello,
If this really is your first project, then it's ambitious to say the least. Get one LED to work with the built-in examples in the Arduino IDE, like Blink. Get some confidence in getting simple things to work then add to it. Get a good book (I recommend Arduino Cookbook or Jeremy Blum's Exploring Arduino) and work through the examples. I know that it covers multiple LED's and possibly a PIR or the Sharp reflective distance measuring IC - a better approach is to use arrays of LED's instead of lots of pins. You could easily run all those pins on the Uno. If you mess a Mega up, it will hit you in the pocket, because it is almost impossible to repair and just one wire wrong can wipe it out - the Uno uses a replaceable IC costing less than £3, with the bootloader already on it. Later on, you could use the Atmel chips like the ATtiny MCU at less than £1 and still do some impressive projects. Looking at your code, delay(timer) will cause you problems. delay is a reserved function that takes a numeric like 20, where 20 is milliseconds, written as delay(20).
Good luck

Do you have a sketch adapted from those you found on-line that will light one of your LEDs?

Look for the example sketch Blink_Without_Delay. Understand how it is able to continue processing while waiting for a timed event. delay() is a simple hack to get you started but it's not used very often in actual functional Arduino programs.

Store the pattern in an array and then loop along that array.

Yes this is my very first project. We are making a valentines box for school and wanted the light sequence to start when someone put something in his box (hence the PIR). I do use a volt meter and solder everyday so thats no problem, its the programming. I have no programming experience what so ever. The code is one i copied from a "knight rider" sketch i found online. I have it to were the lights come in the pattern, but just lost with adding the pir sensor. guess if I cant find a solution ill just put it on a switch for tomorrow. I have the pir connected to pin 9 as a input. I did find a shorter code but it still uses the delay function.

int pinArray[] = {22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48};
int count = 0;
int timer = 30;
int val = 0;

void setup(){
  
  for (count=0;count<14;count++) {
    pinMode(pinArray[count], OUTPUT);
    pinMode(9, INPUT);
  }
}

void loop() {
  val = digitalRead(9);
  
  for (count=0;count<13;count++) {
   digitalWrite(pinArray[count], HIGH);
   delay(timer);
   digitalWrite(pinArray[count + 1], HIGH);
   delay(timer);
   digitalWrite(pinArray[count], LOW);
   delay(timer*2);
  }
  for (count=13;count>0;count--) {
   digitalWrite(pinArray[count], HIGH);
   delay(timer);
   digitalWrite(pinArray[count - 1], HIGH);
   delay(timer);
   digitalWrite(pinArray[count], LOW);
   delay(timer*2);
   
   
  }
}

So if I understand correctly, you don't have a problem with lighting or sequencing the LEDs, but you are having trouble getting them to "run" when the PIR senses motion.

There is nothing in your code to do something "If" the PIR input pin is high.

http://arduino.cc/en/Reference/If

Delay() works but does just what it says - it pauses the program, big delays can make you wait a long time wondering what's going on. It took me ages to get my head around Blink without delay because it uses the millis() function that counts the number of milliseconds since the program started running i.e from the point where you powered it up, or pressed the reset button, or ran the Serial Monitor. millis() returns the value of of the current value of the tick counter (sorry PLC jargon), so writing Time = millis() gives you something like 66778899 - it can be a big number as it's an unsigned long number 2^32 - it's like the now() function in Excel.
The best bit of advice I found on using millis() is to see it as a timestamp - use say timeNow and previousTime as the program runs - the delay will be the difference between the two.
If this is for Valentines Day, you might be better off with a box of choccies and some red roses - then I'm no expert on that either