Change color
Hello,
I'm making a game in Adobe Flash Professional CS6 using Actionscript 2.0
I've made my character (named player) and everything and now i want to add an fun easter egg.
What is want is that when you press the keys: UP, DOWN, RIGHT, LEFT, W, A, S and D that there will be a filter added that make everything yellowish.
I couldn't find any code to do this so i decided to make only the character yellow, this also didn't work.
My question is if anyone knows a code to make a filter on a frame.
My current code is:
onClipEvent (enterFrame) { powerleft = 5; powerright = 10; powerupdown = 7;
if(Key.isDown(Key.SHIFT)){
powerright = 15;
}
else {
powerright = 10;
}
if (Key.isDown(Key.RIGHT) and (Key.isDown(Key.LEFT) and (Key.isDown(UP) and (Key.isDown(DOWN) and (Key.isDown(87) and (Key.isDown(65) and (Key.isDown(83) and (Key.isDown(68))))))))) {
myColor = new Color(player);
myColor.setRGB(0xff00ff);
}
if (Key.isDown(Key.RIGHT)) { this._xscale = 100; this._x += powerright; if(jumping){ this.gotoAndStop(3);
}
else { this.gotoAndStop(1); }
}
if (Key.isDown(Key.LEFT)) { this._xscale = 100; this._x -= powerleft; if(jumping){ this.gotoAndStop(3);
}
else { this.gotoAndStop(1); }
}
if (Key.isDown(Key.UP)) { this._xscale = 100; this._y -= powerupdown; if(jumping){ this.gotoAndStop(3);
}
else { this.gotoAndStop(1); }
}
if (Key.isDown(Key.DOWN)) { this._xscale = 100; this._y += powerupdown; if(jumping){ this.gotoAndStop(3);
}
else { this.gotoAndStop(1); }
}
if (!Key.isDown(Key.DOWN) and (!Key.isDown(Key.UP) and (!Key.isDown(Key.LEFT) and (!Key.isDown(Key.RIGHT))))) { this.gotoAndStop(2); }
}
onClipEvent(enterFrame) { if(_root.player.hitTest(_root.wall1)) { this._x +=25; }
}
onClipEvent(enterFrame) { if(_root.player.hitTest(_root.wall2)) { this._x -=25; }
}
onClipEvent(enterFrame) { if(_root.player.hitTest(_root.ceiling)) { this._y +=25; }
}
onClipEvent(enterFrame) { if(_root.player.hitTest(_root.ground)) { this._y -=25; }
}
It's all about the
if (Key.isDown(Key.RIGHT) and (Key.isDown(Key.LEFT) and (Key.isDown(UP) and (Key.isDown(DOWN) and (Key.isDown(87) and (Key.isDown(65) and (Key.isDown(83) and (Key.isDown(68))))))))) {
myColor = new Color(player);
myColor.setRGB(0xff00ff);
}
part.
Can anyone help me?
Thanks for your advice.
