To do the speed thing on another motor, just double up the code and adjust the pins and variables.
Something like this: untested, ymmv
int joy1 = 0;
int motor = 3;
int joy2 = 1;
int motor2 = 5; // pin 4 isn't pwm so use 5
void setup(){
pinMode(motor,OUTPUT);
pinMode(joy1,INPUT);
pinMode(motor2,OUTPUT);
pinMode(joy2,INPUT);
}
void loop(){
int ppp;
int ppp2;
ppp = analogRead(joy1);
ppp = map(ppp, 0, 1023, -255, 255);
analogWrite(motor,ppp);
ppp2 = analogRead(joy2);
ppp2 = map(ppp2, 0, 1023, -255, 255);
analogWrite(motor,ppp2);
}
For direction, you will need to give details about the connections to the motor. Direction control needs an h-bridge to reverse the polarity on the motor. Can you post a circuit diagram?