The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.39 / 5.00 38,635 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 15,161 ViewsHello. I cannot figure out how I would create something so when you press an arrow key, a character changes what it looks like. For example, when you press right the character goes looks to its right, and vice versa for left. I have tried making multiple frames in the Movie Clip but it still isn't working. Please help!
If you post your FLA I can do a sample and write comments next to the code.
web sizzle www.jeremynative.com
if(Key.isDown(Key.RIGHT)){
this._xscale *= -1;
}
and vice versa for left.
Something like that.
At 12/3/10 11:58 PM, Kevin wrote: if(Key.isDown(Key.RIGHT)){
this._xscale *= -1;
}and vice versa for left.Something like that.
An easier way to do it would be just:
if(Key.isDown(Key.RIGHT)){
this._x+=5;
}
At 12/3/10 11:58 PM, Kevin wrote: if(Key.isDown(Key.RIGHT)){
this._xscale *= -1;
}and vice versa for left.Something like that.
Yeah! Imagine that you change the xscale of the character from positive 100% to negative 100%. This will make him turn around
Check out the coolest Donkey Kong Game on NG!
http://www.newgrounds.com/portal/vi ew/459064
100 posts @ Posted at: 9/15/08 07:36 AM http://www.newgrounds.com/bbs/topic /969232
Kevin, that'll make the movieclip flip constantly.
var _faceLeft:Number = this._xscale;
onEnterFrame = function() {
if(Key.isDown(Key.RIGHT)){
this._xscale = -_faceLeft;
}
}