Hi,
I'm trying to make a simple game of spaceship flying in the space. I filled the sky with star shapes.
public class Star extends Shape {
public function Star(color:String) {
super();
var points:Array = [new Point(...... ]//an array of point of the star
graphics.lineStyle(1,color);
graphics.beginFill(color);
graphics.moveTo(25,0);
for each (var p:Point in points) {
graphics.lineTo(p.x,p.y);
}
graphics.endFill();
Now I want the stars to flicker somehow. I tried to use filters but it slows down the game a lot - having 50 stars, each with a filter, and then framerate drops to 1frame/s or less.
So I wanted to try using alpha but it doesn't work on starling Shape class. I had this problem before in this thread
Back then I needed just 3 textures, but now I need at least 100 stars on screen. So it seems counterproductive to generate star using flash.display.Shape, then change it to Bitmap, then to Texture, so then I could use 'alpha' property on it.
Is there any other (simpler?) way of making many stars with ability to manipulate their alpha?
Alternatively should 50 shapes with filter slow down the framerate so much? Or am I doing something wrong?