Make an item glow when the player is walking
Hi,
I'm making a game (point & click) and I'm trying to make the usable item glow when the player is walking.
It’s quite simple but I don’t why I fail..I must miss something.
I have already the code as my usable item is glowing when I'm putting it on an other usable item...
So I've got a Engine class (where I'm trying to put the code that make the item glow when the player is walking.
And a DraggedItem Class (This class allows the user to drag inventory items over the stage).
In my DraggedItem class I've got this function :
private function itemGlow(isGlowing:Boolean):void{
if (isGlowing){
var glow:GlowFilter = new GlowFilter();
glow.color = 0xFFFF00;
glow.alpha = .75;
glow.blurX = 10;
glow.blurY = 10;
glow.quality = BitmapFilterQuality.MEDIUM;
draggedItem.filters = [glow];
} else {
draggedItem.filters = null;
}
}
So, in my Engine class I'd like to use this function when my player is walking.
I tought I could put something like this :
back = new Background(stage, thisBack);
back.currentBack.ground.addEventListener(MouseEvent.MOUSE_DOWN, shineItems, false, 0, true);
private function shineItems(e:MouseEvent):void{
trace(shineItems);
var thisClip = usableItems
if (playerControl){
stage.dispatchEvent(new Event("playerMoving"));
draggedItem.itemGlow;
}
}
But it's not it.
I've must import the function in the wrong way...
So I've try to add in the Engine Class (and change "draggedItem.itemGlow;" by "itemGlow;")
private function itemGlow(isGlowing:Boolean):void{
if (isGlowing){
var glow:GlowFilter = new GlowFilter();
var thisClip = usableItems
glow.color = 0xFFFF00;
glow.alpha = .75;
glow.blurX = 10;
glow.blurY = 10;
glow.quality = BitmapFilterQuality.MEDIUM;
thisClip.filters = [glow];
} else {
thisClip.filters = null;
}
}
But it's not working either....
Any idea ?
