Enemy ai and backroundscroll with char

how do i make enemy A.I. and make them shoot back and how do i make the side scroll when i go to the right like in mario games(platform games is what i mean) i will add u to my credits if u help

-thnx:link: