Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
822 lines (748 loc) · 24 KB
/
Copy pathindex.html
File metadata and controls
822 lines (748 loc) · 24 KB
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
<!DOCTYPE html>
<html>
<head>
<title>PyJay Docs</title>
<link rel="icon" type="image/x-icon" href="pyJay.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Damion&display=swap" rel="stylesheet">
<style>
body {
background-color: #b3dbc3;
}
h1 {
font-family: "Damion", cursive;
color: blue;
}
h3 {
color: darkblue;
font-size: 20px;
}
h5 {
font-size: 15px;
color: #4467dd;
}
pre {
background-color: white;
border-color: black;
border-style: solid;
border-width: 1px;
}
.tip {
color: red;
}
#border {
border: 1px solid darkblue;
width: 100%;
height: 10px;
background-color: #d9e072;
}
</style>
</head>
<body>
<div style="background-color:black;">
<img src="pyJay.png" style="float:left; width:60px; padding-right:10px;">
<h1 style="font-size:50px;">Welcome to <i style="color:#d9e072;">PyJay</i>!</h1>
</div>
<hr>
<div>
<h3>Table of Contents</h3>
<details>
<summary>Map</summary>
<a href="#map_init">Arguments</a>
<br>
<a href="#map_fun">Functions</a>
<br>
<a href="#map_other">Other requirements</a>
<br>
<a href="#map_ex">Example</a>
</details>
<br>
<details>
<summary>Interactable</summary>
<a href="#int_init">Arguments</a>
<br>
<a href="#int_fun">Functions</a>
<br>
<a href="#int_other">Other requirements</a>
<br>
<a href="#int_ex">Example</a>
</details>
<br>
<details>
<summary>Button</summary>
<a href="#but_init">Arguments</a>
<br>
<a href="#but_fun">Functions</a>
<br>
<a href="#but_ex">Example</a>
</details>
<br>
<details>
<summary>Particle</summary>
<a href="#par_init">Arguments</a>
<br>
<a href="#par_fun">Functions</a>
<br>
<a href="#par_ex">Example</a>
</details>
<br>
<details>
<summary>Animation</summary>
<a href="#anim_init">Arguments</a>
<br>
<a href="#anim_fun">Functions</a>
<br>
<a href="#anim_ex">Example</a>
</details>
<br>
<details>
<summary>Announcement</summary>
<a href="#ann_init">Arguments</a>
<br>
<a href="#ann_fun">Functions</a>
<br>
<a href="#ann_ex">Example</a>
</details>
<br>
<details>
<summary>Data management</summary>
<a href="#dat_init">Arguments</a>
<br>
<a href="#dat_fun">Functions</a>
<br>
<a href="#dat_ex">Example</a>
</details>
</div>
<hr>
<div id="border"></div>
<hr>
<div>
<a id="map_init"><h3>pyJay.map()</h3></a>
<h5>Required arguments:</h5>
<p> pyJay.map(map_info)</p>
<h5>Optional arguments:</h5>
<p>pyJay.map(map_info,collider,map_x,map_y,extension)</p>
<h5>Syntax:</h5>
<p>
<b>map_info: (str): </b>
<br>- A path to a '.txt' file containing the information for loading the map
<br><b>collider: (bool): </b>
<br>- Allows you to get hitboxes from the map tiles (default False)
<br><b>map_x: (int): </b>
<br>- Starting position of the map on the x-axis (default 0)
<br><b>map_y: (int): </b>
<br>- Starting position of the map on the y-axis (default 0)
<br><b>extension: (str): </b>
<br>- The extension of your images (default '.png')
</p>
<hr>
<a id="map_fun"><h3>pyJay.map() functions</h3></a>
<h5>display(surface,display_box)</h5>
<p>Displays the map to the surface you put into the surface argument. Does not display if you set collider to True.</p>
<p>display_box is a rect around the screen. PyJay will only draw images that are within the display box to reduce lag.</p>
<h5>move(x,y)</h5>
<p>Moves the entire map by the number of pixels specified in the x-axis and the y-axis</p>
<h5>collide()</h5>
<p>Returns a list of rects that you can use as hitboxes to collide with. Only works when collider is set to True</p>
<hr>
<a id="map_other"><h3>What else to do</h3></a>
<p>Each map will need a map data file. This will be a '.txt' file and contain four (4) lines of text. The first two lines are paths (str) and the last two are numbers (int).</p>
<pre>
path/to/image_set/folder
path/to/map_layout/file.txt
tile_size
scale
</pre>
<p>
<b>path/to/image_set/folder</b>
<br>- This will be a path to a folder containing all the images you need for that map.
<br><b>path/to/map_layout/file</b>
<br>- This will be a path to the layout of your map. This file needs to follow a few rules as well.
<br><b><span class="tip">map_layout rules:</span></b>
<br>- Each character corresponds to an image name in the path/to/image_set/folder (ex: '1' on the map will display '1.png')
<br>- Each tile may only correspond to ONE character in the map_layout
<br>- You cannot use the 0 character.
<br>- The 0 character will display a blank tile.
<br><b>tile_size</b>
<br>- This is a number (int) that represents the size of the image. (ex: A 32x32 image will be a value of 32 in this line)
<br><b>scale</b>
<br>- This will scale all tiles by multiplying the image size by this amount (ex: 1 will keep it the same size, and 2 will double the size)
</p>
<p>Each map will also need a <em>map_layout</em> file. This will be a '.txt' file and be the "key" that pyJay uses. Make each number correspond to an image tile. </p>
<p>When <em>collider</em> is set to True, every tile that doesn't have a value of 0 will create a hitbox. </p>
<pre>
1222223
4FFFFF5
4FFFFF5
6777778
</pre>
<hr>
<a id='map_ex'><h3>Example:</h3></a>
<p>File system:</p>
<pre>
-> root
main.py
pyJay.py
-> img
-> basement
1.png
2.png
3.png
-> floor_one
A.jpg
B.jpg
C.jpg
-> map_data
basement_data.txt
floor_one_data.txt
-> map_layouts
basement.txt
floor_one.txt
</pre>
<p>main.py</p>
<pre>
import pygame, sys
#Don't forget to import pyJay!
import pyJay
#Pygame setup
pygame.init()
screen = pygame.display.set_mode((700,700))
clock = pygame.time.Clock()
#Define two maps using pyJay
#This one just uses the defaults
basement = pyJay.map('map_data/basement_data.txt')
#This one uses '.jpg' images, so we have to pass all the arguments
floor_one = pyJay.map('map_data/floor_one.txt',False,0,0,'.jpg')
#Game loop
while True:
screen.fill((0,0,0))
#Make display box around entire screen
display_box = pygame.Rect((0,0),(screen.get_width(),screen.get_height()))
#Display the basement map
basement.display(screen,display_box)
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
#Move the map when the arrow keys are pressed
if event.key == pygame.K_UP:
basement.move(0,-5)
if event.key == pygame.K_DOWN:
basement.move(0,5)
if event.key == pygame.K_LEFT:
basement.move(-5,0)
if event.key == pygame.K_RIGHT:
basement.move(5,0)
pygame.display.flip()
clock.tick(60)
</pre>
<p>basement_data.txt</p>
<pre>
img/basement/
map_layouts/basement.txt
32
2
</pre>
<p>floor_one_data.txt</p>
<pre>
img/floor_one/
map_layouts/floor_one.txt
16
4
</pre>
<p>basement.txt</p>
<pre>
11111
12221
12021
12221
11311
</pre>
<p>floor_one.txt</p>
<pre>
AAAAA
ABBBA
AB0BA
ABBBA
AACAA
</pre>
</div>
<hr>
<div id="border"></div>
<hr>
<div>
<a id="int_init"><h3>pyJay.interactable()</h3></a>
<h5>Required arguments:</h5>
<p>pyJay.interactable(file)</p>
<h5>Syntax:</h5>
<p>
<b>file: (str):</b>
<br>- A path to the configuration file
</p>
<hr>
<a id="int_fun"><h3>pyJay.interactable() functions</h3></a>
<h5>collide(plRect)</h5>
<p>Check to see if the plRect (pygame Rect object) collides with an interactable tile</p>
<h5>move(x,y)</h5>
<p>Move all interactables along the x and y axis (in pixels)</p>
<h5>display(screen)</h5>
<p>Draw the hitboxes to the suface passed through <em>screen</em></p>
<hr>
<a id="int_other"><h3>What else to do</h3></a>
<p>Instead of individually defining hitboxes in the space, PyJay uses something simmilar to the way maps are made. You will need a data file and a layout file</p>
<p>The configuration file will need to be a .json and contain the following things:</p>
<pre>
{
"objects": [
{
"key": "1",
"function": "function_when_collide(1)"
},
{
"key": "2",
"function": "function_when_collide(2)"
}
],
"map_data": {
"file": "path/to/map_layout.txt",
"width": tile_width,
"height": tile_height
}
}
</pre>
<p>
<b>objects</b>
<br>This is a list containing JSON objects to controll interactable tiles
<br><b>- - key</b>
<br>- - - This is what character on the layout file does what function
<br><b>- - function</b>
<br>- - - This is what will run when collided with the <em>key</em> tile. This should be a Python function (which is defined in your main.py)
<br>
<br><b>map_data</b>
<br>This contains information about how to display your interactables
<br><b>- - file</b>
<br>- - - This is a path to your map layout file
<br><b>- - width</b>
<br>- - - This is the width of each tile
<br><b>- - height</b>
<br>- - - This is the height of each tile
</p>
<p>You will also need to make a map layout. This follows the same rules as the <a href="#map_other">pyJay.map()</a> rules</p>
<hr>
<a id="int_ex"><h3>Example:</h3></a>
<p>File system:</p>
<pre>
-> root
main.py
pyJay.py
-> layouts
map_layout.txt
-> interactable
config.json
</pre>
<p>main.py</p>
<pre>
import pygame, sys
#Don't forget to import pyJay!
import pyJay
#pygame setup
pygame.init()
screen = pygame.display.set_mode((700,700))
clock = pygame.time.Clock()
#define an interactable map
interact = pyJay.interactable('interactable/config.json')
#Define something to happen when you hit an interactable
def quit():
pygame.quit()
#game loop
while True:
screen.fill((0,0,0))
#display hitboxes for debugging
interact.display(screen)
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
#Move the map when the arrow keys are pressed
if event.key == pygame.K_UP:
interact.move(0,-5)
if event.key == pygame.K_DOWN:
interact.move(0,5)
if event.key == pygame.K_LEFT:
interact.move(-5,0)
if event.key == pygame.K_RIGHT:
interact.move(5,0)
pygame.display.flip()
clock.tick(60)
</pre>
<p>config.json</p>
<pre>
{
"objects": [
{
"key": "1",
"function": "quit()"
}
],
"map_data": {
"file": "layouts/map_layout.txt",
"width": 64,
"height": 64
}
}
</pre>
<p>map_layout.txt</p>
<pre>
0000000
0000000
0001000
0000000
0000000
</pre>
</div>
<hr>
<div id="border"></div>
<hr>
<div>
<a id="but_init"><h3>pyJay.button()</h3></a>
<h5>Required arguments:</h5>
<p> pyJay.button(x,y,text)</p>
<h5>Syntax:</h5>
<p>
<b>x: (int):</b>
<br>- The x location for the center of the button
<br><b>y: (int): </b>
<br>- The y location for the center of the button
<br><b>text: (str): </b>
<br>- The text the button displays
</p>
<hr>
<a id="but_fun"><h3>pyJay.button() functions</h3></a>
<h5>display(surface)</h5>
<p>Displays the button to the surface you put into the surface argument</p>
<h5>get_click(mouse_position)</h5>
<p>Returns True if the mouse_position (tuple) is colliding with the button.</p>
<p class="tip">TIP: Pass pygame.mouse.get_pos() into the mouse_position argument</p>
<hr>
<a id="but_ex"><h3>Example:</h3></a>
<p>File system:</p>
<pre>
-> root
main.py
pyJay.py
</pre>
<p>main.py</p>
<pre>
import pygame, sys
#Don't forget to import pyJay!
import pyJay
#Pygame setup
pygame.init()
screen = pygame.display.set_mode((700,700))
clock = pygame.time.Clock()
#Define a button using pyJay
exit_button = pyJay.button(350,350,'Exit Game')
#Game loop
while True:
screen.fill((0,0,0))
#Display the button to the screen
exit_button.display(screen)
for event in pygame.event.get():
if event.type == pygame.MOUSEBUTTONDOWN:
#Check to see if button was clicked
if exit_button.get_click(pygame.mouse.get_pos()):
pygame.quit()
sys.exit()
pygame.display.flip()
clock.tick(60)
</pre>
</div>
<hr>
<div id="border"></div>
<hr>
<div>
<a id="par_init"><h3>pyJay.particle()</h3></a>
<h5>Required arguments:</h5>
<p>pyJay.particle(startX,startY,color,size,speed)</p>
<h5>Optional arguments:</h5>
<p>pyJay.particle(startX,startY,color,size,speed,lifetime)</p>
<h5>Syntax:</h5>
<p>
<b>startX: (int):</b>
<br>- The x location the particles emmit from
<br><b>startY: (int):</b>
<br>- The y location the partciles emmit from
<br><b>color: (tuple):</b>
<br>- RGB value of the particle color
<br><b>size: (int):</b>
<br>- The size (in pixels) of each particle
<br><b>speed: (int):</b>
<br>- How fast (in pixels per frame) the particle moves
<br><b>lifetime: (int):</b>
<br>- How long (in frames) the particles may last up to (Default 60)
</p>
<hr>
<a id="par_fun"><h3>pyJay.particle() functions</h3></a>
<h5>move()</h5>
<p>Moves the particles. Direction is automatically calculated</p>
<h5>lifetime_check()</h5>
<p>Returns <em>True</em> if a particle's lifetime is over</p>
<h5>display(screen)</h5>
<p>Displays the particle to the surface passed</p>
<hr>
<a id="par_ex"><h3>Example:</h3></a>
<p>File system:</p>
<pre>
-> root
main.py
pyJay.py
</pre>
<p>main.py</p>
<pre>
import pygame, sys
#Don't forget to import pyJay!
import pyJay
#Pygame setup
pygame.init()
screen = pygame.display.set_mode((700,700))
clock = pygame.time.Clock()
#Make a list containing multiple particles to make a particle effect!
particles = []
for i in range(0,20):
par = pyJay.particle(50,50,(255,255,0),5,2)
particles.append(par)
#Game loop
while True:
screen.fill((0,0,0))
#Display the button to the screen
exit_button.display(screen)
for particle in particles:
#Move every particle
particle.move()
#Display every parrticle
particle.display(screen)
#Delete particle if it's lifetime is over
if particle.lifetime_check():
particles.remove(particle)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
pygame.display.flip()
clock.tick(60)
</pre>
</div>
<hr>
<div id="border"></div>
<hr>
<div>
<a id="anim_init"><h3>pyJay.animation()</h3></a>
<h5>Required argments:</h5>
<p>pyJay.animation(folder,noOfFrames)</p>
<h5>Optional arguments:</h5>
<p>pyJay.animation(folder,noOfFrames,speed=1,filetype='.png')</p>
<h5>Syntax:</h5>
<p>
<b>folder: (str):</b>
<br>- Path to a folder with all your frames
<br><b>noOfFrames: (int):</b>
<br>- The number of frames in the animation
<br><b>speed: (int):</b>
<br>- How many game frames it takes to update the animation frame (Default 1)
<br><b>filetype: (str):</b>
<br>- The filetype of the images (Default '.png')
</p>
<p class="tip">NOTE: In your folder, name the frames as the frame number. Start with Zero (0)</p>
<hr>
<a id="anim_fun"><h3>pyJay.animation() functions</h3></a>
<h5>slide()</h5>
<p>"Slides" the animation to the next frame</p>
<h5>display(screen,x,y)</h5>
<p>Displays the current frame to the surface passed to the x and y coordinates</p>
<hr>
<a id="anim_ex"><h3>Example:</h3></a>
<p>File system:</p>
<pre>
-> root
main.py
-> player_idle
0.png
1.png
3.png
4.png
5.png
6.png
</pre>
<p>main.py</p>
<pre>
import pygame, sys
#Don't forget to import pyJay!
import pyJay
#Pygame setup
pygame.init()
screen = pygame.display.set_mode((700,700))
clock = pygame.time.Clock()
font = (pygame.font.Font(None,50)
#Define your animation
idle = pyJay.animation('player_idle',7,30)
#Game loop
while True:
screen.fill((0,0,0))
#Update the animation, then display it
idle.slide()
idle.display(screen,50,50)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
pygame.display.flip()
clock.tick(60)
</pre>
</div>
<hr>
<div id="border"></div>
<hr>
<div>
<a id="ann_init"><h3>pyJay.announcement()</h3></a>
<h5>Required arguments:</h5>
<p>pyJay.announcement(text,img,color,font,surface)</p>
<h5>Syntax:</h5>
<p>
<b>text: (str):</b>
<br>- The text that should display when the announcement is shown
<br><b>img: (str):</b>
<br>- A path to the image that should be displayed behind the text
<br><b>color: (tuple):</b>
<br>- A tuple containing RGB values for the text color
<br><b>font: (pygame object):</b>
<br>- A font that has been loaded with <em>pygame.font.Font()</em>
<br><b>surface: (pygame object):</b>
<br>- A pygame surface that the announcement will be displayed to
</p>
<hr>
<a id="ann_fun"><h3>pyJay.announcement() functions</h3></a>
<h5>announcement.display()</h5>
<p>Display the announcement</p>
<h5>announcement.move()</h5>
<p>Moves the announcement across the screen</p>
<h5>announcement.reset()</h5>
<p>Resets the announcement position</p>
<p class="tip">TIP: Use <em>if announcement_name.text_x >= screen.get_width():</em> to see if the announcement is over.</p>
<hr>
<a id="ann_ex"><h3>Example:</h3></a>
<p>File system:</p>
<pre>
-> root
main.py
pyJay.py
-> img
->ui
banner.png
</pre>
<p>main.py</p>
<pre>
import pygame, sys
#Don't forget to import pyJay!
import pyJay
#Pygame setup
pygame.init()
screen = pygame.display.set_mode((700,700))
clock = pygame.time.Clock()
font = (pygame.font.Font(None,50)
#Define announcement
level_up = elem.announcement('Level Up!','img/ui/banner.png',(0,255,0),font,screen)
#Game loop
while True:
screen.fill((0,0,0))
if level_upping:
#move announcement
level_up.move()
#Display announcement
level_up.display()
#Reset when it goes off-screen
if level_up.text_x > screen.get_width():
level_upping = False
level_up.reset()
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
pygame.display.flip()
clock.tick(60)
</pre>
</div>
<hr>
<div id="border"></div>
<hr>
<div>
<a id="dat_init"><h3>pyJay.data_management()</h3></a>
<h5>Required arguments:</h5>
<p>pyJay.data_management(file_name)</p>
<h5>Syntax:</h5>
<p>
<b>file_name: (str):</b>
<br>- A path to the save file
</p>
<hr>
<a id="dat_fun"><h3>pyJay.data_management() functions</h3></a>
<h5>data_management.save(data)</h5>
<p>Saves a dictionary (data) to the save file</p>
<h5>data_management.load()</h5>
<p>Returns the data in the save file as a dictionary</p>
<hr>
<a id="dat_ex"><h3>Example:</h3></a>
<p>File system:</p>
<pre>
-> root
main.py
pyJay.py
-> saves
save_file.json
</pre>
<p>main.py</p>
<pre>
import pygame, sys
#Don't forget to import pyJay!
import pyJay
#Pygame setup
pygame.init()
screen = pygame.display.set_mode((700,700))
clock = pygame.time.Clock()
#Define a save object
save_obj = pyJay.data_management('saves/save_file')
#Make a dictionary with defaults (In case a save file isn't found)
player_data = {
'x_pos': 100,
'y_pos': 300,
'skin': 'tennis_steve'
}
#Replace dictionary with data from the save file
try:
player_data = save_obj.load()
except:
#If something fails, return an error and continue
print('Save file not found')
print('Loading with defaults')
#Game loop
while True:
screen.fill((0,0,0))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
#Save data when quitting game
save_obj.save(player_data)
pygame.display.flip()
clock.tick(60)
</pre>
<p>save_file.json</p>
<pre>
{
"x_pos": 150,
"y_pos": 200,
"skin": "tuxedo_steve"
}
</pre>
</div>
<hr>
<div id="border"></div>
<hr>
</body>
</html>