You can use 2D or 3D to achieve this. My current WIP (Ker-Bang) uses a background that scrolls at a different rate.
Here's a quick example. Use camX# and camY# as variables that store your current camera position and then position foreground and background sprites in a position proportional to that variable:
LOAD IMAGE "media\bg.bmp", 1,1
LOAD IMAGE "media\mid.bmp", 2,1
LOAD IMAGE "media\for.bmp", 3,1
SPRITE 1, screen width(), screen height(), 1
SPRITE 2, screen width(), screen height(), 2
SPRITE 3, screen width(), screen height(), 3
SYNC ON : SYNC RATE 60
DO
camX#=camX#+rightkey()-leftkey()
camY#=camY#+upkey()-downkey()
PASTE SPRITE 1, camX#*0.9, camY#
PASTE SPRITE 2, camX#, camY#
PASTE SPRITE 2, camX#*1.1, camY#
SYNC
LOOP
Just a quick example...