Like I said, it is the little details that make a good game great - now although this little game is never going to be great as it stands, a bit more work and suddenly we could end up with a huge berzerk style game. It wouldn't take too much imagination to turn this basic idea into a fun little romp really, would it? And having shown you how to move a tiled background in sympathy with your player movements, now, if you imagined the player staying still in the centre of the screen, and the background moving around him, you can see how giant scrolling play areas are achieved.
So, what is wrong with our code as it was? Well, there was nothing wrong with it as such, but there is a little detail that has been overlooked - so let's put that right now.
Imagine our player walking from left to right. The background neatly scrolls from right to left, and everything looks wonderful, except for one thing - really, the enemy movement should also be affected by what our player is doing on screen. So, now have another look in the updateplayer function. We have added the following lines:
FOREACH en IN enemies[]
en.enx=en.enx-dirx
en.eny=en.eny-diry
IF en.enx<-32 OR en.enx>640 OR en.eny<-32 OR en.eny>480 THEN DELETE en
NEXT
Now for each movement the player does, just as the background move in sympathy, so do the enemies. There, it easy enough to do, but if you try running it again you will see it makes a big difference to the overall impression to the game.