Forums

ForumsProgramming Forum

Arrow key scripting and quality control (I need a genuis!)

Posted Mar 17, '12 at 5:48pm

PerryThePlatypus3

PerryThePlatypus3

24 posts

My brother wants to me to ask you people on moving a character with arrow keys, and specificly wants it with the character running when you press the button, not just a person looking at you and gliding up, left, right, and down if you understand what i mean.

He also

 

Posted Mar 17, '12 at 6:00pm

PerryThePlatypus3

PerryThePlatypus3

24 posts

Sorry i sorta clicked something. Anyways he also wants the person who is playing his game control the quality settings in 5 different qualities which is low, medium, high, Best, and automatic (adaptable).

My brother uses Macromedia Flash 8 (the symbol with a circle and an f in the middle), he knows how to make buttons, frames and a funny movie so don't worry about that.

Oh he also would like if the arrow keys can be changed by the person who is playing his game in the options.

 

Posted Mar 17, '12 at 6:45pm

Schmiddy1234

Schmiddy1234

887 posts

lol... that movie link that u put was really funny :D

 

Posted Mar 18, '12 at 5:56am

brickbeard

brickbeard

71 posts

the movie is really weird ( and funny )

 

Posted Mar 20, '12 at 9:07pm

PerryThePlatypus3

PerryThePlatypus3

24 posts

It's all thanks to by brother! here is v3.0!
But lets get back to scripting please.

 

Posted Mar 22, '12 at 4:32am

ExplosionsHurt

ExplosionsHurt

247 posts

Is he using Actionscript 2, or Actionscript 3? Arrow key control is implemented quite differently in each one.

 

Posted Mar 25, '12 at 8:14pm

PerryThePlatypus3

PerryThePlatypus3

24 posts

action script 2

 

Posted Apr 9, '12 at 4:22pm

arobegamr

arobegamr

120 posts

Flash player only has three qualities, "low", "medium", and "high".

By default, the context menu (what appears on a right-click) for an swf file has the quality setting which can be changed by the user.

You can edit this in actionscript 2 by modifying the _quality property.
Example: _quality = "low"

If you want the quality to be able to change automatically, I suppose you can have flash player monitor the milliseconds per frame using getTimer(), and if there is lag, change this attribute.  Also, if you have effects (such as particle effects), you can turn them off.

For example:
fps = 12;
lag = 100;
lastTimer = getTimer();
onEnterFrame = function(){
timer = getTimer();
if(timer-lastTimer>1000/fps+lag){
_quality = "low";
particleEffectsOn = false;
}else{
_quality = "high";
particleEffectsOn = true;
lastTimer = timer();
}
}

The fps property defines the frames per second of the swf, so we can calculate the milliseconds per frame at optimum level.  I went with the default 12.
The lag property determines how much lag the player will tolerate before lowering the quality, higher value = higher lag tolerance.
The property particleEffectsOn is useless until particle effects are added, and only display when the value is true.

Keep in mind I'm just throwing this out there, I haven't tested it, so it may not work as well as it is meant to.

 

Posted Apr 9, '12 at 4:25pm

arobegamr

arobegamr

120 posts

Correction:

fps = 12;
lag = 100;
lastTimer = getTimer();
onEnterFrame = function(){
timer = getTimer();
if(timer-lastTimer>1000/fps+lag){
_quality = "low";
particleEffectsOn = false;
}else{
_quality = "high";
particleEffectsOn = true;
}
lastTimer = timer;
}

 

Posted Jun 25, '12 at 9:28pm

PerryThePlatypus3

PerryThePlatypus3

24 posts

hey guys my brother has updated the animation with a new url! [url=http://fireninjagames.webs.com/animations/basketballmistake_V2.0.htm]
he added a loadbar to it, but it loads to fast 4 you to see. Anyways he says thanks for everyones help and if you have more scipting ideas, please share

 
Reply to Arrow key scripting and quality control (I need a genuis!)

You must be logged in to post a reply!