-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.js
1815 lines (1532 loc) · 35.2 KB
/
game.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//snowmen
var snowflake_x = [];
var snowflake_y = [];
var snowflake_sc = [];
var num_snowflakes;
//tree variables
var tree_loc = [];
var tree_green = [];
//snowmen variables
var snowX = []; //X location of each snowman
var snowY = []; //Y location of ecah snowman
var dx = []; //horizontal movement of the the snowmen
var dy = []; // verticle movemnent of the snowmen
var num_snowmen; //how many snowmen before the game ends
var scaleSnow; //size of the snowmen
var snowRM; //is the snowman moving right
var snowRM2;
var animate; //do the snowmen move
var snowR;
var snowR2;
var snow_downCounter; //keeps track of which snowmen is moving down
var snowman_movementAllowed = [];
var counter; //keeps track of the time
//santa variable
//KIMS VAR
var xS, yS; //location of the snowman
var dir; //snowman movement
var scl; //size of the snowmen
var reg;
var movement_allowed;
var sArmR, sArmL;
var sArmRReach, sArmLReach;
var sLegRB, sLegRF, sLegLB, sLegLF;
var sLegRBReach, sLegRFReach, sLegLBReach, sLegLFReach;
var thro;
//candycane variables
var num_canes;
var cane_loc = []; //tracks the location of the cane
var cane_dy; //speed of the candycane
var cane_count; //which cane is moving
var cane_img0;
var cane_img1;
var cane_color0;
var cane_color1;
var cane_up = []; //controls whether the cane is moving
var throw_allowed;
var seconds; //tracks how many seconds pass
var points; //how much every snowmen is worth
var game_score; //how many points have been scored = displayed
var santa_lives; //how many lives left in the game
var startup; //the image is displayed before the start of the game
var info;
var gameLost;
var gameWon;
var reset;
//firework variables
var systems = [];
var launch;
var fire_counter;
var cX,cY;
var fire_color = [];
var system_ok = [];
var losescreen1;
var losescreen2;
var winscreen1;
var winscreen2;
var fontBold;
var intermed;
var move_on;
var shift_image;
var leftarrow_image;
var rightarrow_image;
var frosty;
var poke1;
var poke2;
var wsong;
var lsong;
var pauseCheck;
function preload()
{
cane_img0 = loadImage("images/candycane.png");
cane_img1 = loadImage("images/candycane.png");
startpage_img = loadImage("images/startup.jpg");
wonderland_title = loadImage("images/winterwonderland.png");
losescreen1 = loadImage("images/fire-mountains.jpg")
losescreen2 = loadImage("images/laughing-snowman-icon.png")
winscreen1 = loadImage("images/christmas-village-wallpaper.jpg");
winscreen2 = loadImage("images/cool-santa.png");
intermed = loadImage("images/startup.jpg")
shift_image = loadImage("images/computer-key-shift.png");
leftarrow_image = loadImage("images/computer-key-arrow-left.png");
rightarrow_image = loadImage("images/computer-key-arrow-right.png");
wonderland_title.loadPixels();
losescreen1.loadPixels();
losescreen2.loadPixels();
winscreen1.loadPixels();
winscreen2.loadPixels();
// cane_img0.loadPixels();
//cane_img1.loadPixels();
/*frosty = loadSound('frosty.mp3');
poke1 = loadSound('BeginingPoke.mp3');
poke2 = loadSound('EndPoke.mp3');
wsong = loadSound('WinSong.mp3');
lsong = loadSound('LoseSong.mp3');*/
}
function setup()
{
createCanvas(1000,1000);
background(255);
frameRate(60);
colorMode(RGB, 255, 255, 255, 100);
fire_counter = 0;
for (var i=0; i<num_snowmen; i++)
{
snowX.push(0);
snowY.push(0);
dx.push(0);
dy.push(0);
snowman_movementAllowed.push(false);
//snow_downCounter.push(0);
}
initialize();
updatePixels();
for(var x=0; x<cane_img0.width; x++)
{
for(var y=0; y<cane_img0.height; y++)
{
if(red(cane_img0.get(x,y)) > 100 && blue(cane_img0.get(x,y)) < 200)
{
cane_img0.set(x,y,[0,90,0,255]);
}
}
}
/*for(var x=0; x<cane_img1.width; x++)
{
for(var y=0; y<cane_img1.height; y++)
{
if(red(cane_img1.get(x,y)) > 200 && brightness(cane_img0.get(x,y)) < 98)
{
cane_img1.set(x,y,[145,0,0,100]);
}
}
}*/
losescreen1.updatePixels();
losescreen2.updatePixels();
winscreen1.updatePixels();
winscreen2.updatePixels();
cane_img0.updatePixels();
//cane_img1.updatePixels();
for (var i=0; i<num_snowflakes; i++)
{
snowflake_x.push(random(100,900));
snowflake_y.push(random(100,700));
snowflake_sc.push(random(.3,1))
}
for (var i=0; i<num_canes; i++)
{
cane_loc.push(createVector(500,1500));
}
for (var i=0; i<num_snowmen; i++)
{
snowX.push(random(111,890));
snowY.push(100);
dx.push(random(-7,7));
dy.push(1.2);
snowman_movementAllowed.push(false);
//snow_downCounter.push(0);
}
for(var x=30; x<230; x+=25)
{
for(var y=25; y<400; y+=50)
{
tree_loc.push(createVector(x+random(-10, 10),y+random(-10,10)));
tree_green.push(random(50, 200));
}
}
for(var x=570; x<770; x+=25)
{
for(var y=25; y<400; y+=50)
{
tree_loc.push(createVector(x+random(-10, 10), y+random(-10,10)));
tree_green.push(random(50, 200));
}
}
}
function draw()
{
//var howmanysnwmn = 1;
//game background
noStroke();
fill(255);
rect(100,100,800,600);
snowman_movementAllowed[snow_downCounter] = true;
if (animate)
{
moveSnow();
}
push();
translate(100,100);
for(var i=0; i<tree_loc.length; i++)
{
drawTree(tree_loc[i].x,tree_loc[i].y,tree_green[i],2);
}
pop();
if(startup == false && info == false)
{
for (var i=0; i<snow_downCounter; i++)
{
if(snowman_movementAllowed[i])
{
drawSnowman(snowX[i],snowY[i],scaleSnow);
snowX[i] += dx[i];
snowY[i] += dy[i];
/*if(seconds%20 == 0)
dx[i] += .001;
dy[i] += .001;*/
}
if (snowX[i] >= 890 || snowX[i] < 110)
{
dx[i] = -dx[i];
//snow_downCounter[i]++
}
}
if(counter%100 == 0)
snow_downCounter+=1;
//if(snow_downCounter%6 == 0)
// howmanysnwmn+=3;
counter++;
}
image(cane_img0,cane_loc[0].x,cane_loc[0].y);
image(cane_img1,cane_loc[1].x,cane_loc[1].y);
//KIMS CODE
if (dir == true && reg == false && thro == false)
{
drawSantaL(xS, yS, scl);
}
else if (dir == false && reg == false && thro == false)
{
drawSantaR(xS, yS, scl);
}
else if (reg == true)
{
drawSantaB(xS, yS, scl);
}
else if (thro == true)
{
drawSantaT(xS,yS,scl);
thro = false;
movemnent_allowed = true;
}
//run the firework systems
for(var i=0; i<fire_counter; i++)
{
if(system_ok[i])
systems[i].run();
}
moveSanta();
keyDown();
//keyTyped();
candyCane_Shooter();
gameStatus();
hitting_a_snowman(snow_downCounter);
draw_arcadeMachine();
seconds++;
push();
stroke(255);
textSize(25);
textSize(BOLD);
fill(0);
text("SCORE: " + game_score,800,620);
pop();
if(startup == false && info == false && gameWon == false && gameLost == false)
{
if(pauseCheck == false)
drawPause(850,150);
else
drawPlay(850,150);
}
for(x=100; x<900; x+=10)
{
fill(0);
rect(x,685,5,2);
}
if(startup)
{
start_page();
}
if(info)
{
intermed_page();
}
if(gameWon)
{
winner();
}
if(gameLost)
{
loser();
}
}
function mouseClicked()
{
if(mouseX > 500 - textWidth("START") / 2 && mouseX < 500 + textWidth("START") / 2 && mouseY > 420 && mouseY < 480 && startup == true && info == false)
{
info = true;
startup = false;
redraw();
move_on++;
}
if(gameLost || gameWon)
{
initialize();
loop();
}
if(info && startup == false)
{
move_on++;
if(move_on == 3)
{
info = false;
redraw();
}
}
if (impl_circ(850, 150, 20, mouseX, mouseY) <= 0 && startup == false && info == false && gameWon == false && gameLost == false)
{
if (pauseCheck == false)
{
noLoop();
//drawPlay(700, 100);
pauseCheck = true;
}
else if (pauseCheck == true)
{
loop();
//drawPause(700, 100);
pauseCheck = false;
}
}
}
function impl_circ(cx, cy, radi, in_x, in_y)
{
return ( (in_x-cx)*(in_x-cx) + (in_y-cy)*(in_y-cy) - radi*radi);
}
function drawTree(x, y, green, sc)
{
noStroke();
push();
translate(x, y);
scale(sc);
fill(0, 0, 0);
rect(-2, 2, 4, 25);
fill(0, green, 0);
triangle(0, 0, 10, 10, -10, 10);
triangle(0, 5, 10, 15, -10, 15);
triangle(0, 10, 10, 20, -10, 20);
pop();
}
function draw_arcadeMachine()
{
noStroke();
fill(60,70,255);
//rect(60,60,880,680);
fill(255);
//rect(100,100,800,600);
// square screen boarder
fill(60,70,255);
//top
beginShape();
vertex(60,60);
vertex(940,60);
vertex(940,100);
vertex(60,100);
endShape();
//right
beginShape();
vertex(900,60);
vertex(940,60);
vertex(940,740);
vertex(900,740);
endShape();
//bottom
beginShape();
vertex(940,700);
vertex(940,740);
vertex(60,740);
vertex(60,700);
endShape();
//left
beginShape();
vertex(100,740);
vertex(60,740);
vertex(60,60);
vertex(100,60);
endShape();
noStroke();
fill(255);
rect(0,0,1000,60);
stroke(0);
strokeWeight(0.5);
line(60,60,100,100);
line(940,60,900,100);
line(940,740,900,700);
line(60,740,100,700);
fill(60,70,255);
beginShape();
vertex(60,740);
vertex(940,740);
vertex(1000,850);
vertex(0,850);
endShape();
beginShape();
vertex(0,850);
vertex(1000,850);
vertex(1000,1000);
vertex(0,1000);
endShape();
stroke(0);
strokeWeight(2);
//joystickL
fill(0);
ellipse(150,795,50,20);
fill(150);
rect(147,730,6,65);
fill(255,0,0);
ellipse(150, 730,60);
//buttonsL
fill(255,0,0);
ellipse(260,820,50,20);
ellipse(260,807.5,40,10);
line(260-20,820,260-20,807.5);
line(260+20,820,260+20,807.5);
ellipse(330,820,50,20);
ellipse(330,807.5,40,10);
line(330-20,820,330-20,807.5);
line(330+20,820,330+20,807.5);
ellipse(400,820,50,20);
ellipse(400,807.5,40,10);
line(400-20,820,400-20,807.5);
line(400+20,820,400+20,807.5);
ellipse(260-30,770,50,20);
ellipse(260-30,757.5,40,10);
line(260-50,770,260-50,757.5);
line(260-10,770,260-10,757.5);
ellipse(330-30,770,50,20);
ellipse(330-30,757.5,40,10);
line(330-50,770,330-50,757.5);
line(330-10,770,330-10,757.5);
ellipse(400-30,770,50,20);
ellipse(400-30,757.5,40,10);
line(400-50,770,400-50,757.5);
line(400-10,770,400-10,757.5);
push();
translate(440,0)
//joystickR
stroke(0);
strokeWeight(2);
fill(0);
ellipse(150,795,50,20);
fill(150);
rect(147,730,6,65);
fill(255,0,0);
ellipse(150,730,60);
//buttonsR
fill(255,0,0);
ellipse(260,820,50,20);
ellipse(260,807.5,40,10);
line(260-20,820,260-20,807.5);
line(260+20,820,260+20,807.5);
ellipse(330,820,50,20);
ellipse(330,807.5,40,10);
line(330-20,820,330-20,807.5);
line(330+20,820,330+20,807.5);
ellipse(400,820,50,20);
ellipse(400,807.5,40,10);
line(400-20,820,400-20,807.5);
line(400+20,820,400+20,807.5);
ellipse(260-30,770,50,20);
ellipse(260-30,757.5,40,10);
line(260-50,770,260-50,757.5);
line(260-10,770,260-10,757.5);
ellipse(330-30,770,50,20);
ellipse(330-30,757.5,40,10);
line(330-50,770,330-50,757.5);
line(330-10,770,330-10,757.5);
ellipse(400-30,770,50,20);
ellipse(400-30,757.5,40,10);
line(400-50,770,400-50,757.5);
line(400-10,770,400-10,757.5);
pop();
}
function drawSnowman(x, y, sc){
push();
translate(x,y);
scale(sc);
// arms
stroke(158,95,0);
strokeWeight(4);
push();
translate(66,-35);
rotate(snowR2);
line(0, 0, 79, -45);
line(79,-45,74,-73);
line(79,-45,104,-65);
line(79,-45,106,-40);
pop();
push();
translate(-70,-30);
rotate(snowR);
line(0,0,-75,-50);
line(-75,-50,-70,-75);
line(-75,-50,-90,-75);
line(-75,-50,-100,-50);
pop();
strokeWeight(1);
stroke(0);
fill(255);
// body
ellipse(0,160,220,210);
ellipse(0,15,180,170);
// scarf/head
//ellipse(300,270,150,38);
ellipse(0,-130,150);
noStroke();
//rect(249,255,102,30);
fill(200,20,44);
arc(-51,-60,30,30,HALF_PI,3*HALF_PI);
arc(51,-60,30,30,-HALF_PI,-3*HALF_PI);
fill(58,180,36);
rect(-51,-75,20,30);
fill(200,20,44);
rect(-31,-75,20,30);
fill(58,180,36);
rect(-11,-75,20,30);
fill(200,20,44);
rect(9,-75,20,30);
fill(58,180,36);
rect(29,-75,22,30);
fill(58,180,36);
rect(18,-45,30,90);
fill(200,20,44);
rect(18,-45,30,20);
fill(58,180,36);
rect(18,-25,30,20);
fill(200,20,44);
rect(18,-5,30,20);
fill(58,180,36);
rect(18,15,30,20);
fill(200,20,44);
rect(18,35,30,10);
fill(200,20,44);
rect(10,-75,30,100);
fill(58,180,36);
rect(10,-45,30,20);
fill(200,20,44);
rect(10,-25,30,20);
fill(58,180,36);
rect(10,-5,30,20);
fill(200,20,44);
rect(10,15,30,20);
fill(58,180,36);
rect(10,35,30,20);
// eyes
fill(255,0,0);
ellipse(-22,-145,15,22);
ellipse(22,-145,15,22);
/*fill(255);
ellipse(-22,-149,5,8);
ellipse(22,-149,5,8);*/
triangle(-29,-147,-23,-147,-27,-162);
triangle(-27,-147,-18,-147,-22,-167);
triangle(-22,-147,-15,-147,-17,-162);
triangle(15,-147,21,-147,17,-162);
triangle(17,-147,26,-147,22,-167);
triangle(22,-147,29,-147,27,-162);
//eyebrow
stroke(0);
strokeWeight(10);
line(-40,-180,-12,-164);
line(10,-164,38,-180);
noStroke();
// nose
fill(255,134,68);
ellipse(0,-120,10,20);
triangle(0,-130,0,-110,50,-125);
// mouth
fill(0);
ellipse(-35,-100,5);
ellipse(-30,-95,5);
ellipse(-24,-90,5);
ellipse(-18,-87,5);
ellipse(-12,-86,5);
ellipse(-6,-85,5);
ellipse(0,-85,5);
ellipse(6,-85,5);
ellipse(12,-86,5);
ellipse(18,-88,5);
ellipse(24,-90,5);
ellipse(30,-94,5);
ellipse(35,-100,5);
// hat
fill(38,43,46);
ellipse(0,-190,160,30);
rect(-50,-290,100,100);
fill(255,0,0);
rect(-51,-215,102,25);
// buttons
fill(0);
ellipse(0,-30,10);
ellipse(0,0,10);
ellipse(0,30,10);
noFill();
pop();
}
function moveSnow()
{
if (snowRM == true)
{
snowR -= .07;
}
else
{
snowR += .07;
}
if (snowR < -1)
{
snowRM = false;
}
if (snowR > 0.2)
{
snowRM = true;
}
if (snowRM2 == true)
{
snowR2 -= .08
}
else
{
snowR2 += .08
}
if (snowR2 < -.3)
{
snowRM2 = false;
}
if (snowR2 > 1)
{
snowRM2 = true;
}
}
//KIMS CODE
function drawSantaL(x, y, scl)
{
push();
stroke(0);
translate(x, y);
scale(scl);
/*//leg behind body
fill(255, 0, 0);
ellipse(-5, 115, 25, 60);*/
//leg behind body
push();
fill(255, 0, 0);
translate(-5, 115);
rotate(sLegLB);
translate(0, 7);
ellipse(0, 0, 25, 60);
fill(0);
ellipse(-7, 30, 20, 9);
pop();
//body
fill(255, 0, 0);
ellipse(0, 60, 60, 100);
//belt
fill(0);
rect(-30, 70, 58, 11);
//face
fill(248, 224, 203);
ellipse(0, 0, 60);
//hat
fill(255, 0, 0);
triangle(-30, -25, 0, -80, 30, -25);
triangle(0, -80, 12, -85, 3, -73);
fill(255);
rect(-30, -35, 60, 15);
ellipse(12, -85, 10);
/*//legs
fill(255, 0, 0);
ellipse(5, 115, 25, 60);*/
//legs
push();
fill(255, 0, 0);
translate(5, 115);
rotate(sLegLF);
translate(0, 7);
ellipse(0, 0, 25, 60);
fill(0);
ellipse(-7, 30, 20, 9);
pop();
//arms
push();
fill(255, 0, 0);
translate(15, 60);
rotate(sArmL);
translate(0, 7);
ellipse(0, 0, 20, 55);
fill(0);
ellipse(0, 30, 15);
fill(255);
rect(-10, 20, 19, 7);
pop();
//eyes
fill(0);
ellipse(-20, 0, 10);
fill(255);
ellipse(-22, 0, 7);
//eyebrows
fill(255);
push();
translate(-20, -7);
rotate(PI/6);
ellipse(0, 0, 20, 7);
pop();
//beard
fill(255);
beginShape();
vertex(20, -10);
vertex(5, 10);
vertex(-30, 10);
vertex(-39, 37);
vertex(15, 20);
endShape(CLOSE);
//nose
fill(248, 224, 203);
ellipse(-30, 7, 8);
pop();
}
function drawSantaR(x, y, scl)
{
push();
stroke(0);
translate(x, y);
scale(scl);
//leg behind body
push();
fill(255, 0, 0);
translate(5, 115);
rotate(sLegRB);
translate(0, 7);
ellipse(0, 0, 25, 60);
fill(0);
ellipse(7, 30, 20, 9);
pop();
//body
fill(255, 0, 0);
ellipse(0, 60, 60, 100);
//belt
fill(0);
rect(-30, 70, 58, 11);
//face
fill(248, 224, 203);
ellipse(0, 0, 60);
//hat
fill(255, 0, 0);
triangle(-30, -25, 0, -80, 30, -25);
triangle(0, -80, -12, -85, -3, -73);
fill(255);
rect(-30, -35, 60, 15);
ellipse(-12, -85, 10);
//legs
push();
fill(255, 0, 0);
translate(-5, 115);
rotate(sLegRF);
translate(0, 7);
ellipse(0, 0, 25, 60);
fill(0);
ellipse(7, 30, 20, 9);
pop();
//arms
push();
fill(255, 0, 0);
translate(-15, 60);
rotate(sArmR);
translate(0, 7);
ellipse(0, 0, 20, 55);
fill(0);
ellipse(0, 30, 15);
fill(255);
rect(-10, 20, 19, 7);
pop();
//eyes
fill(0);
ellipse(20, 0, 10);
fill(255);
ellipse(22, 0, 7);
//eyebrows
fill(255);
push();
translate(20, -7);
rotate(-PI/6);
ellipse(0, 0, 20, 7);
pop();
//beard
fill(255);
beginShape();
vertex(-20, -10);
vertex(-5, 10);
vertex(30, 10);
vertex(39, 37);
vertex(-15, 20);
endShape(CLOSE);
//nose
fill(248, 224, 203);
ellipse(30, 7, 8);
pop();
}
function drawSantaB(x, y, scl)
{
push();
stroke(0);
translate(x, y);
scale(scl);
//leg behind body
fill(255, 0, 0);
ellipse(10, 115, 15, 60);
ellipse(-10, 115, 15, 60);
//shoes
fill(0);
ellipse(10, 147, 10, 7);
ellipse(-10, 147, 10, 7);