I have made a game in which you must run through a maze.
The x and y positions of the walls are set by random.
You must destroy all the enemies with your bombs to get to the next level. (exit -> is behind the bushes - bomb them)
(in reality -> when you get to the next level - the game simply restarts)
Problem: the game runs slower and slower each time you get to the next level
ha, i think i had that problem once with one of my files... strange thing, i just compressed it (.zip) and it opened correctly...
so it's maybe a header problem...
I did not look at your source file. But I can tell you what usually causes something like this (other than the obvious case where too much is going on).
Typically, if your game just gets slower and slower for no apparent reason, then you have a memory leak.
A memory leak occurs when stored data is not getting cleaned up. In the case of Flash 4 there really was no easy way around this since you couldn't use local vars and there was no 'delete' keyword. In Flash 5, MX, and MX 2004 you have options for better memory management.
The answer is to go through your code and clean it up a bit. Lets say you have this function
Well, temp_x and temp_y are just used as auxilary variables. They are just used temporarily to arrive at a new result. When the function is done you dont need them any longer. So they should be local variables, declared with 'var' syntax, such as:
Code:
function moveCharacter() {
var temp_x = current_x+30;
var temp_y = current_y+20;
char._x = temp_x;
char._y = temp_y;
}
That way they are removed from memory when the function is finished.
It is a very common problem for a person to code a game (say 600+ lines of code) where no local variables are used. In that case, the Flash player will have to keep track of a buttload of data that it shouldn't be.