I am looking to have an alien in pixi fade out all pixelated-like when it has reached the center of the screen. I am very new to Pixi, and coding in general, and haven't had luck with JQuery communicating with Pixi. Is there a filter that I can use to make this creature fade out? I currently have the alien simply disappearing when he reaches the center of the screen per the below code, but that doesn't look cool.
function animate() {
spaceship.position.x += (target.x - spaceship.x) * 0.1;
spaceship.position.y += (target.y - spaceship.y) * 0.1;
if (alien.position.x <= window.innerWidth/2) {
alien.position.x += 2;
}
if (alien.position.x === window.innerWidth/2) {
alien.visible = false;
}
if(Math.abs(spaceship.x - target.x) < 1) {
reset();
}
renderer.render(stage);
requestAnimationFrame(animate);
}
Please help.