Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-28-2004, 12:43 PM   #1
icanubis
Registered User
 
Join Date: Aug 2004
Posts: 1
Question Preformance issues...

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.
Code:
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).
Code:
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.

Last edited by icanubis; 08-28-2004 at 01:35 PM.
icanubis is offline   Reply With Quote
Old 09-03-2004, 10:44 PM   #2
roguebot989
Shy Boy Extroadinair
 
Join Date: Sep 2004
Posts: 21
Default

first of all... awesome game.

i think the problem is that you're just using to many enemies, the excess amount of movie clips on the stage make the game slow, nothing about how you're doing the script. Also that many tanks can make the game unfun. and also, the start button needs to have a box around it so you don't have to click the thin letters. and also, the weapon firing thingy could use an upgrade, it fires to slow to be effective against the tanks. but nothing wrong with the script. oh and, try not to use gradients or complicated textures, they tend to cause lag to.
roguebot989 is offline   Reply With Quote
Old 09-03-2004, 10:50 PM   #3
roguebot989
Shy Boy Extroadinair
 
Join Date: Sep 2004
Posts: 21
Default

now that i think about it, it's definintly the gradients, a single color makes the rendering of the game quick and easy. for games you want anything that moves to be a simple and as small a file size as possible. leave gradients for things like the loading pages or movies. and i'm assuming you're only using vector images right? not bitmaps?
roguebot989 is offline   Reply With Quote
Old 09-06-2004, 08:58 AM   #4
Dr Warm
Getting there(in flash)
 
Join Date: Feb 2004
Location: Australia
Posts: 131
Default

Yeah those explosion circles must have the max amount of gradients, not very wise! Yeah i find that the vector based engine can be annoying especially with hitTests and stuff, but depends what you want, i like making tile-based games, good tutorials here :
HTML Code:
www.tonypa.pri.ee
infact very good everyone can learn something (or maybe i'm just total noob)
Dr Warm is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:35 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.