Pixel collision probably isn't what you need. With "sprite collision" you don't have to check individual pixels so it's much faster to use (although not as accurate).
sync rate 0
sync on
x = 50
y = 200
x2 = 350
y2 = 200
CurrentImage = 1
CurrentImage2 = 2
` Make truck 1
ink rgb(255,0,0),0
box 0,0,50,20
get image 1,0,0,50,20,1
` Make truck 2
ink rgb(255,255,255),0
box 0,0,50,20
get image 2,0,0,50,20,1
cls
do
` Put the sprites on the screen
sprite 1,x,y,CurrentImage
sprite 2,x2,y2,CurrentImage2
` Check for no sprite collision
if sprite collision(1,2)=0
inc x
dec x2
` If there is sprite collision do this
else
text 0,0,"CRASH!!!"
sync
wait key
end
endif
sync
loop