- /
-
Pacman No Hungry Today
on 9 Nov 2023
- 6
- 42
- 1
- 1
- 353
drawframe(11 ...
);
Write your drawframe function below
%ref:https://www.mathworks.com/matlabcentral/communitycontests/contests/5/entries/12603
function drawframe(ff)
f=0.1;
t=0:f^2:2*pi;
r=pi/4;
p=r*t+r;
if ff<7
patch([cos(p),0],[sin(p),0],'y')
else
patch([cos(p),0]+(4*ff/24),[sin(p),0],'y');
end
c=eye(3);
for a=2:2:6
patch([t/4+a,a+r*(1+cos(t/2)),a],[-f*cos(3*(a+t))-r,r*sin(t/2),-1],c(a/2,:));
patch(a+f*cos(t)'+r./[1,0.65],f*(2+sin(t)').*[1,1],'k','EdgeColor','w','LineWidth',pi)
end
axis equal off
set(gcf,'color','k')
end