Microsoft Small Basic

Program Listing: CPW302-0
' SmallBasic Version 1.2
' Program: BlinkingEyes
' Changelog:
' Author: Pappa Lapub
' Website: https://social.msdn.microsoft.com/Forums/en-US/6d509258-f0fd-4271-bcab-c5a88b9ccd90/mahreen-miangul-may-2018
' ImportURL: http://smallbasic.com/program/?CPW302-0
' Extension: ---
' Comment:
'
' Variables:
' ToDo:
'===============================================================================
delay = 2000
GraphicsWindow.BackgroundColor = "DarkCyan"

' body
GraphicsWindow.BrushColor = "Navy"
haroon1 = Shapes.AddEllipse(200,280)
Shapes.Animate(haroon1, 250,230, delay)

' face
GraphicsWindow.BrushColor = "LightSalmon"
haroon1 = Shapes.AddEllipse(150, 230)
Shapes.Animate(haroon1, 280,40, delay)

'nose
GraphicsWindow.FontSize = 30
GraphicsWindow.BrushColor = "Black"
nose = Shapes.AddText("👃")
Shapes.Animate(nose, 350,150, delay)

' eyes
GraphicsWindow.BrushColor = "Snow"
eye[1] = shapes.addellipse(40,50)
Shapes.animate(eye[1],300, 85, delay)
eye[3] = Shapes.AddEllipse(40,50)
Shapes.Animate(eye[3], 370,85, delay)

' Pupills
GraphicsWindow.BrushColor = "Black"
eye[2] = Shapes.AddEllipse(20,20)
Shapes.Animate(eye[2], 310,100, delay)
eye[4] = Shapes.AddEllipse(20, 20)
Shapes.Animate(eye[4], 380,100, delay)

' mouth
GraphicsWindow.PenColor = "LightSalmon"
GraphicsWindow.BrushColor = "Red"
haroon1 = Shapes.AddEllipse(100,20)
Shapes.Animate(haroon1, 310,200, delay)

GraphicsWindow.BrushColor = "LightSalmon"
haroon1 = Shapes.AddEllipse(100,30)
Shapes.Animate(haroon1, 310,180, delay)

'hands
haroon1 = Shapes.AddEllipse(110,70)
Shapes.Animate(haroon1, 190,300, delay)
haroon1 = Shapes.AddEllipse(110, 70)
Shapes.Animate(haroon1, 420,300, delay)

'fingers
haroon1 = Shapes.AddEllipse(20,60)
Shapes.Animate(haroon1, 235,250, delay)
'Shapes.Animate(haroon1, 300,290, delay)
'Shapes.Rotate(haroon1, 50)

haroon1 = Shapes.AddEllipse(20,60)
Shapes.Animate(haroon1, 400,290, delay)
Shapes.Rotate(haroon1, -50)

haroon1 = Shapes.AddEllipse(20,60)
Shapes.Animate(haroon1, 480,250, delay)

haroon1 = Shapes.AddEllipse(20,60)
Shapes.Animate(haroon1, 505,260, delay)

Program.Delay(delay + 1000)


GraphicsWindow.MouseDown = OnMouseDown

scl = 1
d = 0.1
loop = 1

While "True"
If loop = 1 Then
scl = scl - d
If scl = 0.1 Or scl = 1 Then
d = -d
EndIf
For i = 1 To 4 '2
Shapes.Zoom(eye[i], 1,scl)
EndFor
Program.Delay(90)
EndIf
Program.Delay(10)
EndWhile


' ////////////////// EVENTs ///////////////////
Sub OnMouseDown
loop = Math.Abs(loop - 1)
EndSub