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

11 6456
PerryThePlatypus3
offline
PerryThePlatypus3
26 posts
Shepherd

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

  • 11 Replies
PerryThePlatypus3
offline
PerryThePlatypus3
26 posts
Shepherd

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.

Schmiddy1234
offline
Schmiddy1234
1,075 posts
Nomad

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

brickbeard
offline
brickbeard
520 posts
Farmer

the movie is really weird ( and funny )

PerryThePlatypus3
offline
PerryThePlatypus3
26 posts
Shepherd

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

ExplosionsHurt
offline
ExplosionsHurt
249 posts
Nomad

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

PerryThePlatypus3
offline
PerryThePlatypus3
26 posts
Shepherd

action script 2

arobegamr
offline
arobegamr
130 posts
Nomad

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.

arobegamr
offline
arobegamr
130 posts
Nomad

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;
}

PerryThePlatypus3
offline
PerryThePlatypus3
26 posts
Shepherd

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

dude_gamer
offline
dude_gamer
21 posts
Peasant

??

fiester
offline
fiester
18 posts
Nomad

if you are using as2 you want to set a variable for running and walking and attach it to different keys same idea with as3 too

Showing 1-11 of 11