-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
617 lines (521 loc) · 23.4 KB
/
main.py
File metadata and controls
617 lines (521 loc) · 23.4 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
import pygame
import sys
import random
# Constants for colors
BGCOLOR = (0, 0, 0) # Black background
MAINCOLOR = (255, 255, 255) # White drawings
# Mood Types
DEFAULT = 0
TIRED = 1
ANGRY = 2
HAPPY = 3
# Predefined Positions
N = 1 # North, top center
NE = 2 # North-east, top right
E = 3 # East, middle right
SE = 4 # South-east, bottom right
S = 5 # South, bottom center
SW = 6 # South-west, bottom left
W = 7 # West, middle left
NW = 8 # North-west, top left
class RoboEyes:
def __init__(self, draw_surface, width=320, height=240, frame_rate=50):
"""
Initialize the RoboEyes class.
:param draw_surface: Pygame surface to draw on.
:param width: Screen width in pixels (unrotated).
:param height: Screen height in pixels (unrotated).
:param frame_rate: Maximum frames per second.
"""
self.surface = draw_surface
self.screen_width = width
self.screen_height = height
self.frame_interval = 1000 / frame_rate # in milliseconds
self.fps_timer = pygame.time.get_ticks()
# Mood and expressions
self.tired = False
self.angry = False
self.happy = False
self.curious = False
self.cyclops = False
self.eyeL_open = False
self.eyeR_open = False
# Eye Geometry
self.space_between_default = 10 # Reduced space for larger eyes
self.space_between_current = self.space_between_default
self.space_between_next = self.space_between_default
# Left Eye
self.eyeLwidth_default = 100 # Increased size proportionally
self.eyeLheight_default = 100
self.eyeLwidth_current = self.eyeLwidth_default
self.eyeLheight_current = 1 # start with closed eye
self.eyeLwidth_next = self.eyeLwidth_default
self.eyeLheight_next = self.eyeLheight_default
self.eyeLheight_offset = 0
self.eyeLborder_radius_default = 20 # Increased radius for larger eyes
self.eyeLborder_radius_current = self.eyeLborder_radius_default
self.eyeLborder_radius_next = self.eyeLborder_radius_default
# Right Eye
self.eyeRwidth_default = self.eyeLwidth_default
self.eyeRheight_default = self.eyeLheight_default
self.eyeRwidth_current = self.eyeRwidth_default
self.eyeRheight_current = 1 # start with closed eye
self.eyeRwidth_next = self.eyeRwidth_default
self.eyeRheight_next = self.eyeRheight_default
self.eyeRheight_offset = 0
self.eyeRborder_radius_default = 20
self.eyeRborder_radius_current = self.eyeRborder_radius_default
self.eyeRborder_radius_next = self.eyeRborder_radius_default
# Coordinates
self.eyeLx_default = (self.screen_width - (self.eyeLwidth_default + self.space_between_default + self.eyeRwidth_default)) // 2
self.eyeLy_default = (self.screen_height - self.eyeLheight_default) // 2
self.eyeLx = self.eyeLx_default
self.eyeLy = self.eyeLy_default
self.eyeLx_next = self.eyeLx
self.eyeLy_next = self.eyeLy
self.eyeRx_default = self.eyeLx + self.eyeLwidth_current + self.space_between_default
self.eyeRy_default = self.eyeLy
self.eyeRx = self.eyeRx_default
self.eyeRy = self.eyeRy_default
self.eyeRx_next = self.eyeRx
self.eyeRy_next = self.eyeRy
# Both Eyes
self.eyelids_height_max = self.eyeLheight_default // 2
self.eyelids_tired_height = 0
self.eyelids_tired_height_next = self.eyelids_tired_height
self.eyelids_angry_height = 0
self.eyelids_angry_height_next = self.eyelids_angry_height
self.eyelids_happy_bottom_offset_max = (self.eyeLheight_default // 2) + 6 # Adjusted for larger eyes
self.eyelids_happy_bottom_offset = 0
self.eyelids_happy_bottom_offset_next = 0
# Macro Animations
self.hFlicker = False
self.hFlicker_alternate = False
self.hFlicker_amplitude = 4 # Increased amplitude for larger screen
self.vFlicker = False
self.vFlicker_alternate = False
self.vFlicker_amplitude = 20 # Increased amplitude for larger screen
self.autoblinker = False
self.blink_interval = 2000 # in milliseconds (2 seconds)
self.blink_interval_variation = 4000 # in milliseconds
self.blink_timer = pygame.time.get_ticks()
self.idle = False
self.idle_interval = 5000 # in milliseconds (5 seconds)
self.idle_interval_variation = 5000 # in milliseconds
self.idle_animation_timer = pygame.time.get_ticks()
self.confused = False
self.confused_animation_timer = 0
self.confused_animation_duration = 500 # in milliseconds
self.confused_toggle = True
self.laugh = False
self.laugh_animation_timer = 0
self.laugh_animation_duration = 500 # in milliseconds
self.laugh_toggle = True
# General Setup
def begin(self):
self.clear_display()
self.eyeLheight_current = 1
self.eyeRheight_current = 1
def update(self):
current_time = pygame.time.get_ticks()
if current_time - self.fps_timer >= self.frame_interval:
self.drawEyes()
self.fps_timer = current_time
# Setter Methods
def setFramerate(self, fps):
self.frame_interval = 1000 / fps
def setWidth(self, leftEye, rightEye):
self.eyeLwidth_next = leftEye
self.eyeRwidth_next = rightEye
self.eyeLwidth_default = leftEye
self.eyeRwidth_default = rightEye
def setHeight(self, leftEye, rightEye):
self.eyeLheight_next = leftEye
self.eyeRheight_next = rightEye
self.eyeLheight_default = leftEye
self.eyeRheight_default = rightEye
def setBorderradius(self, leftEye, rightEye):
self.eyeLborder_radius_next = leftEye
self.eyeRborder_radius_next = rightEye
self.eyeLborder_radius_default = leftEye
self.eyeRborder_radius_default = rightEye
def setSpacebetween(self, space):
self.space_between_next = space
self.space_between_default = space
def setMood(self, mood):
if mood == TIRED:
self.tired = True
self.angry = False
self.happy = False
elif mood == ANGRY:
self.tired = False
self.angry = True
self.happy = False
elif mood == HAPPY:
self.tired = False
self.angry = False
self.happy = True
else:
self.tired = False
self.angry = False
self.happy = False
def setPosition(self, position):
if position == N:
self.eyeLx_next = self.getScreenConstraint_X() // 2
self.eyeLy_next = 0
elif position == NE:
self.eyeLx_next = self.getScreenConstraint_X()
self.eyeLy_next = 0
elif position == E:
self.eyeLx_next = self.getScreenConstraint_X()
self.eyeLy_next = self.getScreenConstraint_Y() // 2
elif position == SE:
self.eyeLx_next = self.getScreenConstraint_X()
self.eyeLy_next = self.getScreenConstraint_Y()
elif position == S:
self.eyeLx_next = self.getScreenConstraint_X() // 2
self.eyeLy_next = self.getScreenConstraint_Y()
elif position == SW:
self.eyeLx_next = 0
self.eyeLy_next = self.getScreenConstraint_Y()
elif position == W:
self.eyeLx_next = 0
self.eyeLy_next = self.getScreenConstraint_Y() // 2
elif position == NW:
self.eyeLx_next = 0
self.eyeLy_next = 0
else:
# Default: Middle center
self.eyeLx_next = self.getScreenConstraint_X() // 2
self.eyeLy_next = self.getScreenConstraint_Y() // 2
def setAutoblinker(self, active, interval=2, variation=4):
"""
Set automated eye blinking.
:param active: Boolean to activate/deactivate autoblinker.
:param interval: Basic interval between each blink in seconds.
:param variation: Interval variation range in seconds.
"""
self.autoblinker = active
self.blink_interval = interval * 1000 # convert to milliseconds
self.blink_interval_variation = variation * 1000 # convert to milliseconds
def setIdleMode(self, active, interval=5, variation=5):
"""
Set idle mode for automated eye repositioning.
:param active: Boolean to activate/deactivate idle mode.
:param interval: Basic interval between each repositioning in seconds.
:param variation: Interval variation range in seconds.
"""
self.idle = active
self.idle_interval = interval * 1000 # convert to milliseconds
self.idle_interval_variation = variation * 1000 # convert to milliseconds
def setCuriosity(self, curious_bit):
self.curious = curious_bit
def setCyclops(self, cyclops_bit):
self.cyclops = cyclops_bit
def setHFlicker(self, flicker_bit, amplitude=4):
self.hFlicker = flicker_bit
self.hFlicker_amplitude = amplitude
def setVFlicker(self, flicker_bit, amplitude=20):
self.vFlicker = flicker_bit
self.vFlicker_amplitude = amplitude
# Getter Methods
def getScreenConstraint_X(self):
return self.screen_width - self.eyeLwidth_current - self.space_between_current - self.eyeRwidth_current
def getScreenConstraint_Y(self):
return self.screen_height - self.eyeLheight_default # Using default height
# Blinking Methods
def close(self, left=True, right=True):
if left:
self.eyeLheight_next = 1
self.eyeL_open = False
if right:
self.eyeRheight_next = 1
self.eyeR_open = False
def open_eyes(self, left=True, right=True):
if left:
self.eyeL_open = True
if right:
self.eyeR_open = True
def blink(self, left=True, right=True):
self.close(left, right)
self.open_eyes(left, right)
# Macro Animation Methods
def anim_confused(self):
self.confused = True
def anim_laugh(self):
self.laugh = True
# Drawing Methods
def drawEyes(self):
current_time = pygame.time.get_ticks()
# Pre-Calculations
if self.curious:
if self.eyeLx_next <= 20: # Adjusted threshold for larger screen
self.eyeLheight_offset = 16
elif self.eyeLx_next >= (self.getScreenConstraint_X() - 20) and self.cyclops:
self.eyeLheight_offset = 16
else:
self.eyeLheight_offset = 0 # left eye
if self.eyeRx_next >= self.screen_width - self.eyeRwidth_current - 20:
self.eyeRheight_offset = 16
else:
self.eyeRheight_offset = 0 # right eye
else:
self.eyeLheight_offset = 0
self.eyeRheight_offset = 0
# Left eye height
self.eyeLheight_current = (self.eyeLheight_current + self.eyeLheight_next + self.eyeLheight_offset) // 2
self.eyeLy += ((self.eyeLheight_default - self.eyeLheight_current) // 2)
self.eyeLy -= self.eyeLheight_offset // 2
# Right eye height
self.eyeRheight_current = (self.eyeRheight_current + self.eyeRheight_next + self.eyeRheight_offset) // 2
self.eyeRy += ((self.eyeRheight_default - self.eyeRheight_current) // 2)
self.eyeRy -= self.eyeRheight_offset // 2
# Open eyes again after closing them
if self.eyeL_open:
if self.eyeLheight_current <= 1 + self.eyeLheight_offset:
self.eyeLheight_next = self.eyeLheight_default
if self.eyeR_open:
if self.eyeRheight_current <= 1 + self.eyeRheight_offset:
self.eyeRheight_next = self.eyeRheight_default
# Left eye width
self.eyeLwidth_current = (self.eyeLwidth_current + self.eyeLwidth_next) // 2
# Right eye width
self.eyeRwidth_current = (self.eyeRwidth_current + self.eyeRwidth_next) // 2
# Space between eyes
self.space_between_current = (self.space_between_current + self.space_between_next) // 2
# Left eye coordinates
self.eyeLx = (self.eyeLx + self.eyeLx_next) // 2
self.eyeLy = (self.eyeLy + self.eyeLy_next) // 2
# Right eye coordinates
self.eyeRx_next = self.eyeLx_next + self.eyeLwidth_current + self.space_between_current
self.eyeRy_next = self.eyeLy_next
self.eyeRx = (self.eyeRx + self.eyeRx_next) // 2
self.eyeRy = (self.eyeRy + self.eyeRy_next) // 2
# Left eye border radius
self.eyeLborder_radius_current = (self.eyeLborder_radius_current + self.eyeLborder_radius_next) // 2
# Right eye border radius
self.eyeRborder_radius_current = (self.eyeRborder_radius_current + self.eyeRborder_radius_next) // 2
# Apply Macro Animations
if self.autoblinker and (current_time >= self.blink_timer):
self.blink()
variation = random.randint(0, self.blink_interval_variation)
self.blink_timer = current_time + self.blink_interval + variation
# Laugh Animation
if self.laugh:
if self.laugh_toggle:
self.setVFlicker(True, 10) # Increased amplitude for larger screen
self.laugh_animation_timer = current_time
self.laugh_toggle = False
elif current_time >= self.laugh_animation_timer + self.laugh_animation_duration:
self.setVFlicker(False, 0)
self.laugh_toggle = True
self.laugh = False
# Confused Animation
if self.confused:
if self.confused_toggle:
self.setHFlicker(True, 40) # Increased amplitude for larger screen
self.confused_animation_timer = current_time
self.confused_toggle = False
elif current_time >= self.confused_animation_timer + self.confused_animation_duration:
self.setHFlicker(False, 0)
self.confused_toggle = True
self.confused = False
# Idle Animation
if self.idle and (current_time >= self.idle_animation_timer):
self.eyeLx_next = random.randint(0, self.getScreenConstraint_X())
self.eyeLy_next = random.randint(0, self.getScreenConstraint_Y())
variation = random.randint(0, self.idle_interval_variation)
self.idle_animation_timer = current_time + self.idle_interval + variation
# Horizontal Flicker
if self.hFlicker:
if self.hFlicker_alternate:
self.eyeLx += self.hFlicker_amplitude
self.eyeRx += self.hFlicker_amplitude
else:
self.eyeLx -= self.hFlicker_amplitude
self.eyeRx -= self.hFlicker_amplitude
self.hFlicker_alternate = not self.hFlicker_alternate
# Vertical Flicker
if self.vFlicker:
if self.vFlicker_alternate:
self.eyeLy += self.vFlicker_amplitude
self.eyeRy += self.vFlicker_amplitude
else:
self.eyeLy -= self.vFlicker_amplitude
self.eyeRy -= self.vFlicker_amplitude
self.vFlicker_alternate = not self.vFlicker_alternate
# Cyclops Mode
if self.cyclops:
self.eyeRwidth_current = 0
self.eyeRheight_current = 0
self.space_between_current = 0
# Clear Display
self.clear_display()
# Draw Eyes
self.draw_eye(self.eyeLx, self.eyeLy, self.eyeLwidth_current, self.eyeLheight_current,
self.eyeLborder_radius_current, MAINCOLOR)
if not self.cyclops:
self.draw_eye(self.eyeRx, self.eyeRy, self.eyeRwidth_current, self.eyeRheight_current,
self.eyeRborder_radius_current, MAINCOLOR)
# Mood Transitions
if self.tired:
self.eyelids_tired_height_next = self.eyeLheight_current // 2
self.eyelids_angry_height_next = 0
else:
self.eyelids_tired_height_next = 0
if self.angry:
self.eyelids_angry_height_next = self.eyeLheight_current // 2
self.eyelids_tired_height_next = 0
else:
self.eyelids_angry_height_next = 0
if self.happy:
self.eyelids_happy_bottom_offset_next = self.eyeLheight_current // 2
else:
self.eyelids_happy_bottom_offset_next = 0
# Draw Tired Eyelids
self.eyelids_tired_height = (self.eyelids_tired_height + self.eyelids_tired_height_next) // 2
if not self.cyclops:
# Left Eye
points_left = [
(self.eyeLx, self.eyeLy - 1),
(self.eyeLx + self.eyeLwidth_current, self.eyeLy - 1),
(self.eyeLx, self.eyeLy + self.eyelids_tired_height - 1)
]
pygame.draw.polygon(self.surface, BGCOLOR, points_left)
# Right Eye
points_right = [
(self.eyeRx, self.eyeRy - 1),
(self.eyeRx + self.eyeRwidth_current, self.eyeRy - 1),
(self.eyeRx + self.eyeRwidth_current, self.eyeRy + self.eyelids_tired_height - 1)
]
pygame.draw.polygon(self.surface, BGCOLOR, points_right)
else:
# Cyclops Tired Eyelids
half_width = self.eyeLwidth_current // 2
points_left = [
(self.eyeLx, self.eyeLy - 1),
(self.eyeLx + half_width, self.eyeLy - 1),
(self.eyeLx, self.eyeLy + self.eyelids_tired_height - 1)
]
pygame.draw.polygon(self.surface, BGCOLOR, points_left)
points_right = [
(self.eyeLx + half_width, self.eyeLy - 1),
(self.eyeLx + self.eyeLwidth_current, self.eyeLy - 1),
(self.eyeLx + self.eyeLwidth_current, self.eyeLy + self.eyelids_tired_height - 1)
]
pygame.draw.polygon(self.surface, BGCOLOR, points_right)
# Draw Angry Eyelids
self.eyelids_angry_height = (self.eyelids_angry_height + self.eyelids_angry_height_next) // 2
if not self.cyclops:
# Left Eye
points_left = [
(self.eyeLx, self.eyeLy - 1),
(self.eyeLx + self.eyeLwidth_current, self.eyeLy - 1),
(self.eyeLx + self.eyeLwidth_current, self.eyeLy + self.eyelids_angry_height - 1)
]
pygame.draw.polygon(self.surface, BGCOLOR, points_left)
# Right Eye
points_right = [
(self.eyeRx, self.eyeRy - 1),
(self.eyeRx + self.eyeRwidth_current, self.eyeRy - 1),
(self.eyeRx, self.eyeRy + self.eyelids_angry_height - 1)
]
pygame.draw.polygon(self.surface, BGCOLOR, points_right)
else:
# Cyclops Angry Eyelids
half_width = self.eyeLwidth_current // 2
points_left = [
(self.eyeLx, self.eyeLy - 1),
(self.eyeLx + half_width, self.eyeLy - 1),
(self.eyeLx + half_width, self.eyeLy + self.eyelids_angry_height - 1)
]
pygame.draw.polygon(self.surface, BGCOLOR, points_left)
points_right = [
(self.eyeLx + half_width, self.eyeLy - 1),
(self.eyeLx + self.eyeLwidth_current, self.eyeLy - 1),
(self.eyeLx + half_width, self.eyeLy + self.eyelids_angry_height - 1)
]
pygame.draw.polygon(self.surface, BGCOLOR, points_right)
# Draw Happy Eyelids
self.eyelids_happy_bottom_offset = (self.eyelids_happy_bottom_offset + self.eyelids_happy_bottom_offset_next) // 2
pygame.draw.rect(self.surface, BGCOLOR,
(self.eyeLx - 2, (self.eyeLy + self.eyeLheight_current) - self.eyelids_happy_bottom_offset + 2,
self.eyeLwidth_current + 4, self.eyeLheight_default))
if not self.cyclops:
pygame.draw.rect(self.surface, BGCOLOR,
(self.eyeRx - 2, (self.eyeRy + self.eyeRheight_current) - self.eyelids_happy_bottom_offset + 2,
self.eyeRwidth_current + 4, self.eyeRheight_default))
# Update Display (Handled externally)
# pygame.display.flip() # Removed to handle rotation externally
def draw_eye(self, x, y, width, height, border_radius, color):
# Draw a rounded rectangle representing an eye
eye_rect = pygame.Rect(x, y, width, height)
if border_radius > 0:
pygame.draw.rect(self.surface, color, eye_rect, border_radius=border_radius)
else:
pygame.draw.rect(self.surface, color, eye_rect)
def clear_display(self):
self.surface.fill(BGCOLOR)
# Example usage within a Pygame application
def main():
pygame.init()
# Screen settings
screen_width = 240 # Rotated width
screen_height = 320 # Rotated height
window = pygame.display.set_mode((screen_width, screen_height))
pygame.display.set_caption("RoboEyes Simulation")
# Create a separate surface for drawing (unrotated)
draw_width = 320
draw_height = 240
draw_surface = pygame.Surface((draw_width, draw_height))
draw_surface.fill(BGCOLOR) # Ensure it's cleared initially
# Create RoboEyes instance
robo_eyes = RoboEyes(draw_surface, width=draw_width, height=draw_height, frame_rate=50)
robo_eyes.begin()
# Example configurations
robo_eyes.setMood(DEFAULT)
robo_eyes.setAutoblinker(True, interval=2, variation=3)
robo_eyes.setIdleMode(True, interval=5, variation=5)
robo_eyes.setCuriosity(True)
# robo_eyes.setCyclops(False)
# robo_eyes.setHFlicker(True, amplitude=4)
# robo_eyes.setVFlicker(True, amplitude=20)
clock = pygame.time.Clock()
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
# Example: Change mood with key presses
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_1:
robo_eyes.setMood(TIRED)
elif event.key == pygame.K_2:
robo_eyes.setMood(ANGRY)
elif event.key == pygame.K_3:
robo_eyes.setMood(HAPPY)
elif event.key == pygame.K_0:
robo_eyes.setMood(DEFAULT)
elif event.key == pygame.K_c:
robo_eyes.anim_confused()
elif event.key == pygame.K_l:
robo_eyes.anim_laugh()
# Update RoboEyes
robo_eyes.update()
# Rotate the draw_surface by 90 degrees clockwise
rotated_surface = pygame.transform.rotate(draw_surface, -90)
rotated_rect = rotated_surface.get_rect(center=window.get_rect().center)
# Clear the window before blitting
window.fill(BGCOLOR)
# Blit the rotated surface onto the main window
window.blit(rotated_surface, rotated_rect)
# Optional Debug Drawings
# Uncomment the following lines to add debug shapes
# pygame.draw.rect(draw_surface, (255, 0, 0), (10, 10, 50, 50)) # Red square for debugging
# pygame.draw.circle(draw_surface, (0, 255, 0), (160, 120), 10) # Green circle at center
# Update the display
pygame.display.flip()
# Limit to 60 FPS
clock.tick(60)
if __name__ == "__main__":
main()