% Twinkle
% Click in location of 10 stars and then have them randomly
% twinkle.

% Draw 1-by-1 black background square...
close all
figure
hold on
DrawRect(0,0,1,1,'k')
axis equal off
title('Click 10 points','FontSize',14)

% Star radius and the number of stars...
r = .05;
N = 10;

% Random coordinates....
[x,y] = ginput(N);

% Simulate the twinkling
title('')
T = 20;
for k = 1:T
    for j = 1:N
        if rand(1) < .5
            DrawStar(x(j),y(j),r,'k')
        else
            DrawStar(x(j),y(j),r,'y')
        end
        pause(.01)
    end
end

hold off
