What Circuit is suggesting is what (used) to be used in a lot of production level games. It would work brilliantly here. In essence it is just adding "waypoints" to your map, to get to a certain place the AI pathfind to the nearest waypoint, instead of having to calculate their way to the player. To help find the nearest--or most appropriate--waypoint, you split your game world up into areas. Then, based on what area your path finding entity is in, and its target, you can get the first appropriate waypoint. For example
{ 1 A}{B 2 }
{ 3 Y}{X 4 }
This is an extremely contrived example. However, imagine you have an array: map[2][2]. Say you are a monster in 1, wanting to go to two since the player is in two. You look up map[1][2] and find that you need to to waypoint A, then to waypoint B. After, you are closer to the player, and you find a path from there.
Also, what are you doing for collisions? Remember, you can always x or y sort a bunch of entity objects, then do collisions for them faster by stopping when you reach an x or y value that is impossible to collide with--since you know all further values will be too high. Also by not bothering to check values that are too low.
eg.
Say you have an array of entity locations to check collides with
locations = {1,2 | 4,5 | 12,12 | 67,56 | 34,56..etc}
rough pseudocode
sort locations on X axis //merge sort is usually best since it takes into account temporal localtity
myLocation = 10,10 //or whatever you are checking for collisions with
foreach locations as i
if myLocation-width> i+width
skip collision check, go to next in loop
elseif mylocation+width< i-width
skip collision, go to next in loop
else
do expensive collision check
endforeach
Obviously this lets you cut out as many collision checks as you can. This is a big boost, since collision checks, especially pixel perfect ones, are slow. Even bounding box collisions checks can be sped up by this simple approach.
Better yet, you could use an quadtree. I've used both approach in games, since I have always found collisions to be my bottle neck.
(
http://en.wikipedia.org/wiki/Quadtree)
Finally, don't bother drawing stuff that isn't on screen. Some checks like the following in the draw methods.
if (myXLocation+width < screenLeftX)
skip drawing..
elseif (myXLocation-width > screenRightX)
skip drawing..
//then the same for y values