-
3DFA hobby scripter
better FPS?
Hi,
I'm on the way to create a little 2D roll game,
but the fps sometimes goes very low,
does anyone know a way to improve my game to get a better fps?
Here's my game (beta version)
http://www.lewxx.eu/games/2dp.htm
I got in fight-mode: 15-25 / 50 fps
I think, later when I have added the sounds & more graphics,
the fps will become still less.
I've already included a fps check, that switch quality:
PHP Code:
in StartScript:
quu=1
------------------
Every Frame Script:
if (fps <= 18){
this._highquality=0
} else { // more than 18 fps:
this._highquality=1
}
this helps a little, but it's not very nice
PS: the enemies in fight mode look very awesome, look at them, fantastic!
No, just kidding. I have to create some real enemies, that stick-figures are just for testing.
or should I just wait for the new version of 3DFA with full Flash 9 support?
Last edited by LewxX²; 06-21-2007 at 02:42 PM.
Reason: forgot a questionmark in title ^^
-
3DFA hobby scripter
hmm, can't edit my post, just want to say, that i changed the maximum fps to 40
and the "fps for quality-change to" 15.
-
Game Master
Hmmmm, I'd have to see the code to really help you improve the fps. By the way, how did you make the FPS display in the bottom right?
-
3DFA hobby scripter
FPS Start Script:
PHP Code:
fra=0; t=0; fps=0;
Every Frame Script
PHP Code:
fra++;
if (getTimer()>=t){
fps=fra*2.5+" FPS";
fra=0;
t=getTimer()+400
}
-
Game Master
Oh ok, thanks. Sorry I couldn't help any with your game.
-
3DFA hobby scripter
hmm my start script is about 515 lines
the every-frame-script is just:
PHP Code:
// ===> FPS:
fra++
if (getTimer()>=ti){
if ((fra*2.5) <= 15){
if (quu == 1){
quu=0
this._highquality=0
}
} else {
if (quu == 0){
quu=1
this._highquality=1
}
}
fps=fra*2.5+" FPS"; fra=0; ti=getTimer()+400
}
// ====> Enemy attack
if (in_fight){ //when fighting
wait-- // goes about 10 -130, relative to enemy
if (wait<=0){
root.geg_att() // make damage
}
} else { // when walking on map
w_upd-- // will be set to 15
if (w_upd<=0){
root.upd_bars() // add some hp to bar and update it
}
}
// ====> Read the level data, that should be loaded from an extern file
if (data.loaded && tt){//if loaded: read level-data (only once)
tt = false //tt=true at the start
clv=1 // current-level = start-level = 1
root.read(data.lv1)
root.lvl_info()
}
level = "map "+clv // just to see which level is shown (at the bottom)
PS:
could the low fps be caused by included fonts, or by the gradients?
oh 2:15 in the night (in Germany), hmmm i think I will go to sleep now, tomorrow is school ^^
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
|