   Pygame scrolling background game questions
  I'm making a pygame simple platform game with scrolling background and I'm having some problems with making it work.First problem is, that I made the background to scroll, when the character is somewhere in the center of the screen, which works well for that game, but ... background scrolls, enemies don't, and I don't know what approach should I use for scrolling background.Also, I don't know how to do enemies spawning and AI. How does it work in games like metal slug or castlevania? Is it based on distance, and enemies spawn when player reaches certain point or is it more random?About the AI, I was thinking about it this way:- enemy spawns behind the screen and starts to run in players direction- when it misses player, it rotates and follows it until it gets in contact- when in contact, enemy attacks with random delay, to make it able for player to avoidIs that how it works in the most simple games of this kind, or there is something easier, or more complex about it?   
  Create a list with all your non-player assets (enemies, objects, projectiles, ect).  When your player hits the center of the screen, loop through that list and modify their rect.centerx by the scrolling speed.if player.x => screen.get_width()/2:   for i in assetList: i.x =- background.scrollSpeed;  The illustrative images are missing, but check out this article on scrolling games in GPWiki.   ;Quote:Original post by EsysCreate a list with all your non-player assets (enemies, objects, projectiles, ect).  When your player hits the center of the screen, loop through that list and modify their rect.centerx by the scrolling speed.if player.x => screen.get_width()/2:   for i in assetList: i.x =- background.scrollSpeedThanks, that worked.I also based the events on 'camera' position and it also works fine, and as for enemies, I made it the way I said I would and it also works fine. All that is left is to get rid of the dozens of bugs that came up in the process xDThanks for the link too.   