I shall only lend knowledge, not the code itself.
Moving / scrolling screen:
Left + Right, If player uses arrow keys left or right, speed# will equal 0.09 for right or -0.09 for left
Then you scroll the backgrounds X value by speed#, remembering to reset the speed value back to 0 after this so it doesn't continue scrolling when you stop moving...
Shooting:
If Weapon Fire = 1 then you make the projectile face the direction the gun was aiming, and keep moving it forward until it's out of the screen
Basic AI:
If PlayerY value is greater than computerY value decrease the computerY value
Same with X, then do the opposite for both x and Y
That will just make the "Computer Player" move towards your character
E.g.
____________________________________
---
Player1
---()x=50
---------------
Computer1
---------------() x = 200
____________________________________
Since the computer x value is greater than the player x value it will decrease the computers X value to move it left *towards the player*