-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsketch.js
executable file
·1722 lines (1566 loc) · 43.8 KB
/
sketch.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
/*
- Copy your game project code into this file
- for the p5.Sound library look here https://p5js.org/reference/#/libraries/p5.sound
- for finding cool sounds perhaps look here
https://freesound.org/
gameProject 7 (mpeev001)
The scene of the game is composed of randomly-positioned elements to generate a “new” scene on startGame(). The game features sound for jumping and loss of life tokens on contact with a snake or falling into a canyon and carefully drawn graphics to be visually attractive. Other extensions added include platforms and enemies.
Platforms resemble rocks, positioned just below the x position of a specified number of random strawberries. The position of these strawberries is adjusted to be relative to the platform rather than the ground so that they can only be collected from a platform. Function createPlatforms() contains a constructor object with three methods - draw() draws a platform template, which is utilised in startGame() to create multiple platforms in a for loop – each with a unique set of random values for positioning as well as length and height. checkContact() checks if the character is standing on a platform and checkPlatformAhead() defines the area of a platform to prevent the character from passing through it.
Enemies are created using the constructor function Enemy() and resemble snakes, which are randomly positioned and crawling in the opposite direction of the character. In contact with a snake, life tokens are reduced by 1 and startGame() re-starts the game.
As a result of building the extensions, I have learnt to use constructer objects (eg. for platforms) and constructor functions (eg. for enemies), position objects randomly or relative to other objects, create random variations of an object and add sound and interaction.
*/
var jumpSound;
var endSound;
var game_score;
var flagpole;
var lives;
var gameChar_x;
var gameChar_y;
var floorPos_y;
var scrollPos;
var gameChar_world_x;
var isLeft;
var isRight;
var isFalling;
var isPlummeting;
var isContact;
var gameCanvas;
var mountains;
var mountains_count;
var clouds;
var clouds_count;
var trees_x;
var trees_scale;
var trees_count;
var canyons;
var canyons_count;
var collectables;
var collectables_count;
var platforms;
var platforms_count;
var enemies;
var enemies_count;
function preload()
{
soundFormats('mp3', 'wav');
//load your sounds here
jumpSound = loadSound('assets/jump.wav');
jumpSound.setVolume(0.1);
endSound = loadSound('assets/end.wav');
endSound.setVolume(0.1);
}
function setup()
{
createCanvas(1024, 576);
floorPos_y = height * 3/4;
lives = 4;
startGame();
}
function startGame()
{
gameChar_x = width/2;
gameChar_y = floorPos_y;
// Variable to control the background scrolling.
scrollPos = 0;
// Variable to store the real position of the gameChar in the game
// world. Needed for collision detection.
gameChar_world_x = gameChar_x - scrollPos;
// Boolean variables to control the movement of the game character.
isLeft = false;
isRight = false;
isFalling = false;
isPlummeting = false;
// Initialise arrays of scenery objects.
game_score = 0;
gameCanvas = 10000;
// Trees
trees_count = gameCanvas/200;
trees_x = [];
for(var i = 0; i < trees_count; i++)
{
trees_x.push(random(200 + i * 200,
400 + i * 200));
}
trees_scale = [];
for(var i = 0; i < trees_count; i++)
{
var tree_scale = random(0.5, 1.5);
trees_scale.push(tree_scale);
}
// Clouds
clouds_count = gameCanvas/300;
clouds = [];
for(var i = 0; i < clouds_count; i++)
{
var cloud = {posX: random(300 + i * 300,
600 + i * 300),
posY: random(80, 180),
scale: random(0.7, 1.0),
speed: random(0.1, 0.3)};
clouds.push(cloud);
}
// Mountains
mountains_count = gameCanvas/600;
mountains = [];
for(var i = 0; i < mountains_count; i++)
{
var mountain = {posX: random(0, gameCanvas),
height: random(150, 250),
width: random(400, 600),
scale: random(0.8, 1.0)};
mountains.push(mountain);
}
// Canyons
canyons_count = gameCanvas/600;
canyons = [];
for(var i = 0; i < canyons_count; i++)
{
var canyon = {posX: random(gameChar_x + 200 + i * 600,
gameChar_x + 600 + i * 600),
width: random(140, 165)};
canyons.push(canyon);
}
// Collectables (strawberries)
collectables_count = gameCanvas/200;
collectables = [];
for(var i = 0; i < collectables_count; i++)
{
var collectable = {posX: random(200 + i * 200,
400 + i * 200),
posY: random(floorPos_y - 60,
floorPos_y - 120),
scale: random(0.7, 1.2),
isFound: false};
collectables.push(collectable);
}
// Collectable (strawberry) counter
gameScoreBackground = {posX: 50,
posY: 50,
scale: 0.6,
isFound: false};
// Flagpole
flagpole = {x_pos: gameCanvas,
isReached: false};
// Decrement lives
lives -= 1;
if(lives < 3)
{
endSound.play();
}
// Platforms
platforms_count = gameCanvas/400;
platforms = [];
for(var i = 0; i < platforms_count; i++)
{
var length = random(90, 120);
var height = random(35, 40);
var pl_y = floorPos_y - height/2;
var randomCollectable = collectables[Math.floor(random(0, collectables.length - 1))];
randomCollectable.posY = pl_y - height/2 - random(180, 190);
var pl_x = randomCollectable.posX - length/2;
for(var j = 0; j < random(0, 2); j++)
{
platforms.push(createPlatform(pl_x + random(-j * length/2,
j * length/2),
pl_y - (j * height * 0.5,
j * height * 0.8),
length,
height));
}
}
// Enemies
enemies_count = gameCanvas/1000;
enemies = [];
for(var i = 0; i < enemies_count; i++)
{
var x = random(0, gameCanvas);
enemies.push( new Enemy(x, floorPos_y));
}
}
function draw()
{
background(100, 155, 255); // fill the sky blue
noStroke();
fill(0,155,0);
rect(0, floorPos_y, width, height/4); // draw some green ground
// Draw clouds.
push();
translate(scrollPos, 0);
drawClouds(clouds_count);
pop();
// Draw mountains.
push();
translate(scrollPos, 0);
drawMountains(mountains_count);
pop();
// Draw trees.
push();
translate(scrollPos, 0);
drawTrees(trees_x, trees_scale);
pop();
// Draw canyons.
push();
translate(scrollPos, 0);
for(var i = 0; i < canyons.length; i++)
{
drawCanyon(canyons[i]);
checkCanyon(canyons[i]);
}
pop();
// Draw platforms
push();
translate(scrollPos, 0);
for(i = 0; i < platforms.length; i++)
{
platforms[i].draw();
}
pop();
// Draw enemies
push();
translate(scrollPos, 0);
for(var i = 0; i < enemies.length; i++)
{
enemies[i].update();
enemies[i].draw();
}
pop();
// Draw collectable items.
push();
translate(scrollPos, 0);
for(var i = 0; i < collectables.length; i++)
{
if(!collectables[i].isFound){
drawCollectable(collectables[i]);
checkCollectable(collectables[i]);
}
}
pop();
// Render flagpole
push();
translate(scrollPos, 0);
renderFlagpole();
pop();
// Check flagpole
if(!flagpole.isReached)
{
checkFlagpole();
}
// Draw game character.
drawGameChar(gameChar_x, gameChar_y);
// Draw game_score
push();
drawCollectable(gameScoreBackground);
fill(255);
textSize(18);
textAlign(CENTER);
text(game_score, 56, 60);
pop();
// Draw lives
for(var i = 0; i < lives; i++)
{
fill(255, 204, 0);
ellipse(100 + 15 * i, 60, 10);
}
//Lives
if(gameChar_y > height && lives > 0)
{
startGame();
}
// Game over
if(lives < 1)
{
fill(0, 0, 0, 150);
rect(0, 0, width, height);
fill(255);
textSize(36);
textAlign(CENTER);
text("Game over. Press space to continue.", width/2, height/2);
return;
}
// Level complete
if(flagpole.isReached)
{
fill(0, 0, 0, 150);
rect(0, 0, width, height);
fill(255);
textSize(36);
textAlign(CENTER);
text("Level complete. Press space to continue.", width/2, height/2);
return;
}
// Game logic
// Enemy ahead
for(var i = 0; i < enemies.length; i++)
{
if(enemies[i].isContact(gameChar_world_x, gameChar_y))
{
startGame();
break;
}
}
// Platform ahead
for(var i = 0; i < platforms.length; i++)
{
if(platforms[i].checkPlatformAhead(gameChar_world_x, gameChar_y))
{
gameChar_y -= 10;
}
}
// Logic to make the game character move or the background scroll.
if(isLeft)
{
if(gameChar_x > width * 0.2)
{
gameChar_x -= 5;
}
else
{
scrollPos += 5;
}
}
if(isRight)
{
if(gameChar_x < width * 0.8)
{
gameChar_x += 5;
}
else
{
scrollPos -= 5; // negative for moving against the background
}
}
// Logic to make the game character rise and fall.
if(gameChar_y < floorPos_y)
{
isContact = false;
for(var i = 0; i < platforms.length; i++)
{
if(platforms[i].checkContact(gameChar_world_x, gameChar_y))
{
isContact = true;
}
}
if(!isContact)
{
gameChar_y += 2;
isFalling = true;
}
else
{
isFalling = false;
}
}
else
{
isFalling = false;
}
if(isPlummeting)
{
gameChar_y += 5;
}
// Update real position of gameChar for collision detection.
gameChar_world_x = gameChar_x - scrollPos;
}
// ---------------------
// Key control functions
// ---------------------
function keyPressed(){
if(flagpole.isReached && key == ' ')
{
nextLevel();
return
}
else if(lives == 0 && key == ' ')
{
returnToStart();
}
if(keyCode == 37)
{
isLeft = true;
}
else if(keyCode == 39)
{
isRight = true;
}
if(keyCode == 32 && (gameChar_y == floorPos_y || isContact == true))
{
gameChar_y -= 120;
jumpSound.play();
}
console.log("press" + keyCode);
console.log("press" + key);
}
function keyReleased()
{
if(keyCode == 37)
{
isLeft = false;
}
else if(keyCode == 39)
{
isRight = false;
}
console.log("release" + keyCode);
console.log("release" + key);
}
// ------------------------------
// Game character render function
// ------------------------------
// Function to draw the game character.
function drawGameChar()
{
// draw game character
if(isLeft && isFalling)
{
// add your jumping-left code
//face
fill(255, 224, 198);
ellipse(gameChar_x,
gameChar_y - 60,
28, 32);
//eyes
fill(255);
ellipse(gameChar_x - 5,
gameChar_y - 60,
6);
fill(38, 197, 255);
ellipse(gameChar_x - 6,
gameChar_y - 60,
4);
fill(0);
ellipse(gameChar_x - 7,
gameChar_y - 60,
2);
//mouth
fill(229, 153, 128);
ellipse(gameChar_x - 10,
gameChar_y - 51,
3, 2);
// right arm
fill(255, 224, 198);
rect(gameChar_x,
gameChar_y - 42,
18, 8,
5);
//clothes
fill(245, 0, 0);
rect(gameChar_x - 12,
gameChar_y - 43,
24, 26,
5);
//clothes legs top
rect(gameChar_x - 8,
gameChar_y - 23,
8, 10,
5);
//legs bottom
fill(255, 224, 198);
rect(gameChar_x - 12,
gameChar_y - 22,
8, 10,
5);
rect(gameChar_x + 2,
gameChar_y - 18,
10, 8,
5);
//clothes legs bottom
fill(245, 0, 0);
rect(gameChar_x - 12,
gameChar_y - 22,
8, 4,
5, 5, 0, 0);
rect(gameChar_x + 2,
gameChar_y - 18,
6, 8,
5, 0, 0, 5);
//pocket
fill(215, 0, 0);
rect(gameChar_x - 14,
gameChar_y - 39,
8, 18,
5);
//arms
fill(255, 224, 198);
rect(gameChar_x - 18,
gameChar_y - 42,
18, 8,
5);
//helmet
fill(255, 0, 0);
rect(gameChar_x - 20,
gameChar_y - 76,
24, 10,
30, 0, 0, 30);
rect(gameChar_x + 4,
gameChar_y - 76,
20, 20,
0, 30, 30, 0);
fill(255, 255, 0);
rect(gameChar_x - 22,
gameChar_y - 74,
10, 6,
30);
//shoes
fill(0, 182, 255);
rect(gameChar_x - 16,
gameChar_y - 14,
12, 6,
4);
rect(gameChar_x + 12,
gameChar_y - 18,
6, 12,
4);
//gloves
ellipse(gameChar_x - 20,
gameChar_y - 38,
8);
fill(0, 152, 225);
ellipse(gameChar_x - 20,
gameChar_y - 38,
6);
}
else if(isRight && isFalling)
{
// add your jumping-right code
//face
fill(255, 224, 198);
ellipse(gameChar_x,
gameChar_y - 60,
28, 32);
//eyes
fill(255);
ellipse(gameChar_x + 5,
gameChar_y - 60,
6);
fill(38, 197, 255);
ellipse(gameChar_x + 6,
gameChar_y - 60,
4);
fill(0);
ellipse(gameChar_x + 7,
gameChar_y - 60,
2);
//mouth
fill(229, 153, 128);
ellipse(gameChar_x + 10,
gameChar_y - 51,
3, 2);
//left arm
fill(255, 224, 198);
rect(gameChar_x - 18,
gameChar_y - 42,
18, 8,
5);
//clothes
fill(245, 0, 0);
rect(gameChar_x - 12,
gameChar_y - 43,
24, 26,
5);
//pocket
fill(215, 0, 0);
rect(gameChar_x + 6,
gameChar_y - 39,
8, 18,
5);
//clothes legs top
fill(245, 0, 0);
rect(gameChar_x + 1,
gameChar_y - 23,
8, 10,
5);
//legs bottom
fill(255, 224, 198);
rect(gameChar_x + 5,
gameChar_y - 22,
8, 10,
5);
rect(gameChar_x - 13,
gameChar_y - 18,
10, 8,
5);
//clothes legs bottom
fill(245, 0, 0);
rect(gameChar_x + 5,
gameChar_y - 22,
8, 4,
5, 5, 0, 0);
rect(gameChar_x - 7,
gameChar_y - 18,
6, 8,
0, 5, 5, 0);
//arms
fill(255, 224, 198);
rect(gameChar_x,
gameChar_y - 42,
18, 8,
5);
//helmet
fill(255, 0, 0);
rect(gameChar_x - 4,
gameChar_y - 76,
24, 10,
0, 30, 30, 0);
rect(gameChar_x - 24,
gameChar_y - 76,
20, 20,
30, 0, 0, 30);
fill(255, 255, 0);
rect(gameChar_x + 12,
gameChar_y - 74,
10, 6,
30);
//shoes
fill(0, 182, 255);
rect(gameChar_x + 6,
gameChar_y - 14,
12, 6,
4);
rect(gameChar_x - 18,
gameChar_y - 18,
6, 12,
4);
//gloves
ellipse(gameChar_x + 20,
gameChar_y - 38,
8);
fill(0, 152, 225);
ellipse(gameChar_x + 20,
gameChar_y - 38,
6);
}
else if(isLeft)
{
// add your walking left code
//face
fill(255, 224, 198);
ellipse(gameChar_x,
gameChar_y - 60,
28, 32);
//eyes
fill(255);
ellipse(gameChar_x - 5,
gameChar_y - 60,
6);
fill(38, 197, 255);
ellipse(gameChar_x - 6,
gameChar_y - 60,
4);
fill(0);
ellipse(gameChar_x - 7,
gameChar_y - 60,
2);
//mouth
fill(229, 153, 128);
ellipse(gameChar_x - 10,
gameChar_y - 51,
3, 2);
//body
fill(255, 224, 198);
//legs
rect(gameChar_x - 14,
gameChar_y - 9,
10, 8,
5);
rect(gameChar_x + 4,
gameChar_y - 9,
10, 8,
5);
//clothes
fill(245, 0, 0);
rect(gameChar_x - 12,
gameChar_y - 43,
24, 26,
5);
rect(gameChar_x - 12,
gameChar_y - 17,
10, 8,
5, 5, 2, 2);
rect(gameChar_x + 2,
gameChar_y - 17,
10, 8,
5, 5, 2, 2);
rect(gameChar_x - 14,
gameChar_y - 9,
10, 4,
2, 2, 0, 0);
rect(gameChar_x + 4,
gameChar_y - 9,
10, 4,
2, 2, 0, 0);
fill(215, 0, 0);
rect(gameChar_x - 14,
gameChar_y - 39,
8, 18,
5);
//arms
fill(255, 224, 198);
rect(gameChar_x - 4,
gameChar_y - 42,
8, 18,
5);
//helmet
fill(255, 0, 0);
rect(gameChar_x - 20,
gameChar_y - 76,
24, 10,
30, 0, 0, 30);
rect(gameChar_x + 4,
gameChar_y - 76,
20, 20,
0, 30, 30, 0);
fill(255, 255, 0);
rect(gameChar_x - 22,
gameChar_y - 74,
10, 6,
30);
//shoes
fill(0, 182, 255);
rect(gameChar_x - 16,
gameChar_y - 2,
12, 6,
4);
rect(gameChar_x + 4,
gameChar_y - 2,
12, 6,
4);
//gloves
ellipse(gameChar_x,
gameChar_y - 22,
10);
fill(0, 162, 235);
ellipse(gameChar_x,
gameChar_y - 22,
6);
}
else if(isRight)
{
// add your walking right code
//face
fill(255, 224, 198);
ellipse(gameChar_x,
gameChar_y - 60,
28, 32);
//eyes
fill(255);
ellipse(gameChar_x + 5,
gameChar_y - 60,
6);
fill(38, 197, 255);
ellipse(gameChar_x + 6,
gameChar_y - 60,
4);
fill(0);
ellipse(gameChar_x + 7,
gameChar_y - 60,
2);
//mouth
fill(229, 153, 128);
ellipse(gameChar_x + 10,
gameChar_y - 51,
3, 2);
//body
fill(255, 224, 198);
//legs
rect(gameChar_x - 14,
gameChar_y - 9,
10, 8,
5);
rect(gameChar_x + 4,
gameChar_y - 9,
10, 8,
5);
//clothes
fill(245, 0, 0);
rect(gameChar_x - 12,
gameChar_y - 43,
24, 26,
5);
rect(gameChar_x - 12,
gameChar_y - 17,
10, 8,
5, 5, 2, 2);
rect(gameChar_x + 2,
gameChar_y - 17,
10, 8,
5, 5, 2, 2);
rect(gameChar_x - 14,
gameChar_y - 9,
10, 4,
2, 2, 0, 0);
rect(gameChar_x + 4,
gameChar_y - 9,
10, 4,
2, 2, 0, 0);
fill(215, 0, 0);
rect(gameChar_x + 6,
gameChar_y - 39,
8, 18,
5);
//arms
fill(255, 224, 198);
rect(gameChar_x - 4,
gameChar_y - 42,
8, 18,
5);
//helmet
fill(255, 0, 0);
rect(gameChar_x - 4,
gameChar_y - 76,
24, 10,
0, 30, 30, 0);
rect(gameChar_x - 24,
gameChar_y - 76,
20, 20,
30, 0, 0, 30);
fill(255, 255, 0);
rect(gameChar_x + 12,
gameChar_y - 74,
10, 6,
30);
//shoes
fill(0, 182, 255);
rect(gameChar_x - 16,
gameChar_y - 2,
12, 6,
4);
rect(gameChar_x + 4,
gameChar_y - 2,
12, 6,
4);
//gloves
ellipse(gameChar_x,
gameChar_y - 22,
10);
fill(0, 162, 235);
ellipse(gameChar_x,
gameChar_y - 22,
6);
}
else if(isFalling)
{
// add your jumping facing forwards code
fill(255, 224, 198);
ellipse(gameChar_x,
gameChar_y - 60,
28, 32);
//eyes
fill(255);
ellipse(gameChar_x - 5,
gameChar_y - 60,
6);
ellipse(gameChar_x + 5,
gameChar_y - 60,
6);
fill(38, 197, 255);
ellipse(gameChar_x - 5,
gameChar_y - 60,
4);
ellipse(gameChar_x + 5,
gameChar_y - 60,
4);
fill(0);
ellipse(gameChar_x - 5,
gameChar_y - 60,
2);
ellipse(gameChar_x + 5,
gameChar_y - 60,
2);
//mouth
fill(229, 153, 128);
ellipse(gameChar_x,
gameChar_y - 51,
6, 2);
//body
fill(255, 224, 198);
//arms
rect(gameChar_x - 28,
gameChar_y - 42,
18, 8,
5);