I need help to control 2 dc motors with a ps2 analog joystick

Looks to me that you have the motor on the wrong side of the transistor. With an npn, the load should be above the collector ie between + and collector, with the emitter to ground. You have the collector to +ve and the load below the emitter.

Have a look here. You also need a diode across the motor as shown in that link. Also probably not wise to supply the motor's power from the Arduino.

Also, worth checking that the power rails on your breadboard go all the way from one end to the other: on some makes there is a break in the middle.

EDIT...

The code seems to use analogWrite with negative values

Well spotted, which makes for a bit of complication since OP presumably wants the joysticks centred to be 0 speed and then left to tuen one way, right the other. Need to think about the mapping for that....

MORE edit... something along the lines of if the stick reads 0 (full left), thats still a 255 PWM on the 293's enable pin and so is 1023, full right. Stick reading of 512 must be pwm of 0? But if the stick is <512 then set the 293's inputs on one channel to be hi/lo and >512, lo/high, so as to reverse the direction between the left and right side of the stick.