-
Slow Running Game With Flash MX
I have a game you can view here www.ownagestudios.com on my site that runs slow sometimes when you shoot and sometimes when enemys apear. Or just because. Im no flash guines yet so I am wondering How could i speed it up?
I am using scenes for different sections of my game ex.
Scenes:
Preloader
Intro
Instructions
Survival Mode
etc.
I dont know if that would be slowing it down.
Thx in advance for all the help
-
Hey Timmy!!!
Howdy, well one thing that comes to mind is that your using scenes. Using scenes usually increases the file size. You could try either loading seperate swf files or having it all on the same timeline.
How exactly are the bad guys and bullets coming onto the stage?
-
Thx for replying so fast.
The enemys, healthpacks, jetpack fire, bullets are all creaed using duplicate movieclip. I can give you the actual code when im out of school.
-
Hey Timmy!!!
Instead you should try attachMovieClip.
-
would that really fix the problem?
how do i use it, I tryed once but the code did not work. Does the movie clip you are attaching have to be off the stage? and how do i do that and still be able to edit its code at the same time?
-
Hey Timmy!!!
It will help a bit, I'd also change the scenes thing too.
Attach movie deals with things that are in the library. And you have to link it. In the library right-click the a movieclip/symbol and select linkage. After that inside of the pop-up box select the first check box, and then in the Identifier text area type in a name for that symbol. That will be the name that you'll use in the code. heres an ex.
_root.attachMovie("linkageName", "new name", this.getNextHighestDepth());
I'd input variables in with the newName, so for bad guys you can multiple guys. It would kinda look like this:
dpie = "piePiece"+currentDegree //where piPiece is he name + a number(currentDegree)
_root.attachMovie("pie", dpie, currentDegree+10);//it attachs pie a clip in the library
// and calls it dpie with the level as a number+10 same as getNextHighestDepth().
-
how do i make actionsciprt work on frames for an object?
-
Hey Timmy!!!
Do you mean like on the frame itself on the main timeline or in the objects timeline? Well if it's in the main timeline then anytime you refer to something you use "_root.and the instance name of the object", you get the instance name from the propretise inspector. If it's inside a movieclip, anytime you refer to the object that your inside you use "this.whatever action your doing", if you refer to something that is outside of the object you use _root, and if it's inside the object like another movieclip you just use the movieclip name.
-
ok i have tryed everything to get the flame to move. i have used a for loop on another object on the main frame. then i have tried putting it on the frame instide it and it does not work.
is there a way to make duplicate object not lag so much
-
Hey Timmy!!!
Could you possible post the code your using
-
ok i will when i get home from school
-
on this is on an object called flamecontroll
Code:
if (_root.jetpack == true) {
if (timetocreate<=0) {
i++;
timetocreate = timetocreateholder;
newname = "flame"+i*100;
_root.attachMovie("jetpack_flame", newname,i);
i++;
timetocreate = timetocreateholder;
newname = "flame"+i*100;
}
}
this is on a mc instance named flame and linked jetpack_flame this is on the first frame inside the flame mc
Code:
this.load = function()
{
this._x = _root.hero._x-10;
loadedvars=true;
this._y = _root.hero._y+20;
xmove = 0;
ymove = 0;
timetokill = 10;
};
this.enterFrame = fucntion()
{
xmove += random(3)*.3;
xmove -= random(3)*.3;
ymove += random(3)*.3;
this._x += xmove;
this._y += ymove;
timetokill --;
if (timetokill <= 0)
{
this.removeMovieClip();
}};
-
why does duplicating lag so much
-
Hey Timmy!!!
Code:
if (_root.jetpack == true) {
if (timetocreate<=0) {
i++;
timetocreate = timetocreateholder;
newname = "flame"+i*100;
_root.attachMovie("jetpack_flame", newname,i);
i++;
timetocreate = timetocreateholder;
newname = "flame"+i*100;
}
}
I'm not sure if it would have anything to do with it, but why is i, timetocreate=timetocreateholder and newname="flame"+1*100 in there twice? Just an idea, cause it looks right to me other than that.
-
is there a way to speed up my game without using attachmovie clip?
if you look at my game:
www.ownagestudios.com/stickmanwars.php
you can see that it lags around 90 kills
-
Hey Timmy!!!
Are you removing the movie clips after you shot them/kill them?
-
yes i am,
on every object that goes away
Code:
this.removieMovieClip();
-
Hey Timmy!!!
Hmm, I'm wondering if there is something that is running in the background.
-
i dont know i think i might have fixed it but now it freeks out. but i know whats wrong so i will fix that when i get home.
But does
unloadMovie(this);
do anything?
-
Hey Timmy!!!
I see, hopefully that does it. As for the unloadMovie thing. It's mainly used if you load a swf/jpg into a movieclip on the stage. It works just like removeMovieClip();
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|