icanubis
08-28-2004, 12:43 PM
Hello...
Just started out with flash but i have programming experiance from java...
Okey... here is the problem...
I'm developing a game in flash just for fun, but when I'm have to much graphics and moving stuff, I allways seems to run in to some preformance issues and evertings starts to lagg badly. But I have seen games with waaay more objects doing fine...
The framerate is 24fps.
Like i said i dont have much flash experiance but some resons I can think of:
1. everything is in vector graphics (is that a preformance issue?)
2. The flash is quite large compared to others. (800x550 px)
Here is an URL to the game:
http://www.elight.se/bg/bg.html
Here are also some cut outs from the as if these hav.
This is the script that generates the units.
for(i=0;i<game.enemiesLeft;i++){
var name = "enemy"+game.currentEnemies;
var temp =new game["Tankp1"]();
duplicateMovieClip("tank",name, 10001+game.currentEnemies);
//_root[name].gotoAndPlay(2);
_root.game.enemies[name] = _root[name];
_root[name] = undefined;
_root.game.enemies[name].vars = temp;
_root.game.enemies[name]._x = game.windowStartY + random(500)+25;
_root.game.enemies[name]._y = game.windowStartY - 20 - random(500);
_root.game.enemies[name]._visible = false;
_root.game.currentEnemies++;
}
This is the script that is moving the units forward (is placed inside every unit).
onClipEvent (enterFrame){
_y += vars.speed;
if(_y > _root.game.windowEndY-25){
_root.score += vars.lostPoints;
_root.game.enemiesLeft--;
removeMovieClip(this);
}
if(_y > (_root.game.windowStartY - 20)){
_visible = true;
}
}
So if someone have any idea I would be glad.
Just started out with flash but i have programming experiance from java...
Okey... here is the problem...
I'm developing a game in flash just for fun, but when I'm have to much graphics and moving stuff, I allways seems to run in to some preformance issues and evertings starts to lagg badly. But I have seen games with waaay more objects doing fine...
The framerate is 24fps.
Like i said i dont have much flash experiance but some resons I can think of:
1. everything is in vector graphics (is that a preformance issue?)
2. The flash is quite large compared to others. (800x550 px)
Here is an URL to the game:
http://www.elight.se/bg/bg.html
Here are also some cut outs from the as if these hav.
This is the script that generates the units.
for(i=0;i<game.enemiesLeft;i++){
var name = "enemy"+game.currentEnemies;
var temp =new game["Tankp1"]();
duplicateMovieClip("tank",name, 10001+game.currentEnemies);
//_root[name].gotoAndPlay(2);
_root.game.enemies[name] = _root[name];
_root[name] = undefined;
_root.game.enemies[name].vars = temp;
_root.game.enemies[name]._x = game.windowStartY + random(500)+25;
_root.game.enemies[name]._y = game.windowStartY - 20 - random(500);
_root.game.enemies[name]._visible = false;
_root.game.currentEnemies++;
}
This is the script that is moving the units forward (is placed inside every unit).
onClipEvent (enterFrame){
_y += vars.speed;
if(_y > _root.game.windowEndY-25){
_root.score += vars.lostPoints;
_root.game.enemiesLeft--;
removeMovieClip(this);
}
if(_y > (_root.game.windowStartY - 20)){
_visible = true;
}
}
So if someone have any idea I would be glad.