diakonas
12-03-2003, 10:32 AM
Hi there!
What I want: (rough example)
when press Key "Right arrow", "Boy_mc" walk, when press "Right arrow" and "Ctrl", "Boy_mc" run, "Space", "Boy_mc" jump,...
So, how to make it? I could set variables "speed" for "walk" and "fast" for "run", but its still only speed of moving movie clip. I want, the "Boy_mc" within "run" move faster its legs and so on...
Idea: (rough example)
Create movie clips for each movement on one timeline, so finally I sould have:
"Boy_mc_walk"(from frame 1 to 5),
"Boy_mc_run"(from frame 6 to 10),
"Boy_mc_jump" (from frame 11 to 15),...
and the Script should look like this:
(I doesnt have any particular code writed down yet....)
function moveBoy() {
if (Key.IsDown(Key.RIGHT))
{ this._x += this.speed;
gotoAndPlay(1);}
if (Key.IsDown(key.RIGHT)) && (Key.IsDown(Key.CONTROL))
{ this._x += this.fast;
gotoAndPlay(6);}
if (Key.IsDown(Key.RIGHT)) && (Key.IsDown(Key.CONTROL)) && (Key.IsDown(Key.SPACE))
{ this._x += fast;
gotoAndPlay(11);}
}
Boy_mc.speed = 2;
Boy_mc.fast = 10;
OK - its only for illustration, I dont know, if this code work...
Sorry for mistakes, Im still beginer. I hope, its clear, what I want to ask. Any suggestions are wellcome
Thanks, frost
What I want: (rough example)
when press Key "Right arrow", "Boy_mc" walk, when press "Right arrow" and "Ctrl", "Boy_mc" run, "Space", "Boy_mc" jump,...
So, how to make it? I could set variables "speed" for "walk" and "fast" for "run", but its still only speed of moving movie clip. I want, the "Boy_mc" within "run" move faster its legs and so on...
Idea: (rough example)
Create movie clips for each movement on one timeline, so finally I sould have:
"Boy_mc_walk"(from frame 1 to 5),
"Boy_mc_run"(from frame 6 to 10),
"Boy_mc_jump" (from frame 11 to 15),...
and the Script should look like this:
(I doesnt have any particular code writed down yet....)
function moveBoy() {
if (Key.IsDown(Key.RIGHT))
{ this._x += this.speed;
gotoAndPlay(1);}
if (Key.IsDown(key.RIGHT)) && (Key.IsDown(Key.CONTROL))
{ this._x += this.fast;
gotoAndPlay(6);}
if (Key.IsDown(Key.RIGHT)) && (Key.IsDown(Key.CONTROL)) && (Key.IsDown(Key.SPACE))
{ this._x += fast;
gotoAndPlay(11);}
}
Boy_mc.speed = 2;
Boy_mc.fast = 10;
OK - its only for illustration, I dont know, if this code work...
Sorry for mistakes, Im still beginer. I hope, its clear, what I want to ask. Any suggestions are wellcome
Thanks, frost