-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
4.2.2 Fried Egg.js
65 lines (61 loc) · 1.79 KB
/
4.2.2 Fried Egg.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//constant variables
var PAN_RADIUS = getWidth()/3;
var HANDLE_WIDTH = getWidth()/2;
var HANDLE_HEIGHT = HANDLE_WIDTH/4;
var PAN_COLOR = Color.GRAY;
var PAN_BOTTOM_RADIUS = PAN_RADIUS-20;
var PAN_BOTTOM_COLOR = Color.BLACK;
var EGG_RADIUS = PAN_BOTTOM_RADIUS/4;
var EGG_WHITE_COLOR = Color.WHITE;
var EGG_YOLK_COLOR = Color.YELLOW;
var HIGHLIGHT_RADIUS = EGG_RADIUS/4;
var HIGHLIGHT_COLOR = Color.WHITE;
//start function
function start() {
var circleD = new Circle(getWidth()/3);
circleD.setColor(Color.GRAY);
circleD.setPosition(200,250);
add(circleD);
var centerX = getWidth()/2 ;
var centurY = getHeight()/2 ;
var rect = new Rectangle(getWidth()/2, HANDLE_WIDTH/4) ;
rect.setColor(Color.GRAY);
rect.setPosition(200,220);
add(rect);
var circleF = new Circle(PAN_RADIUS-20);
circleF.setColor(Color.BLACK);
circleF.setPosition(200,250);
add(circleF);
var circleG = new Circle(PAN_BOTTOM_RADIUS/4);
circleG.setColor(Color.WHITE);
circleG.setPosition(150,250);
add(circleG);
var circleH = new Circle(PAN_BOTTOM_RADIUS/4);
circleH.setColor(Color.WHITE);
circleH.setPosition(180,280);
add(circleH);
var circleJ = new Circle(PAN_BOTTOM_RADIUS/4);
circleJ.setColor(Color.WHITE);
circleJ.setPosition(220,260);
add(circleJ);
var circleK = new Circle(PAN_BOTTOM_RADIUS/4);
circleK.setColor(Color.WHITE);
circleK.setPosition(180,220);
add(circleK);
var circleL = new Circle(PAN_BOTTOM_RADIUS/4);
circleL.setColor(Color.WHITE);
circleL.setPosition(220,220);
add(circleL);
var circleZ = new Circle(PAN_BOTTOM_RADIUS/4);
circleZ.setColor(Color.WHITE);
circleZ.setPosition(190,250);
add(circleZ);
var circleC = new Circle(PAN_BOTTOM_RADIUS/4);
circleC.setColor(Color.YELLOW);
circleC.setPosition(190,250);
add(circleC);
var circleV = new Circle(EGG_RADIUS/4);
circleV.setColor(Color.WHITE);
circleV.setPosition(200,240);
add(circleV);
}