-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcommandDeck.py
850 lines (576 loc) · 25.7 KB
/
commandDeck.py
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
# -*- coding: utf-8 -*-
"""
Created on Sat May 9 13:10:10 2020
Main Command Deck, central operations for all systems in IronSeed.
Note: State button logic will crash game for unimplmented states.
TODO: Ship damage check to see if function available.
@author: Nuke Bloodaxe
"""
import buttons
import pygame
import sys
import os
import io
import random
import planets
import global_constants as g
import helper_functions as h
# The side of a cube, including buttons.
class CubeSide(object):
def __init__(self):
self.top = None
self.bottom = None
self.left = None
self.right = None
self.buttons = []
self.sideName = "BAD FACET"
# Add a button to this facet, and also convert for current resolution.
def addButton(self, height, width, x, y, returnValue, description):
self.buttons.append((returnValue,
buttons.Button(int((g.height/200)*height),
int((g.width/320)
* width),
(int((g.width/320)*x),
int((g.height/200)*y))),
description))
# Update facet name.
def updateSideName(self, name):
self.sideName = name
# Return tuple of False and 0 when nothing matched.
def checkButtonPress(self, position):
match = False
buttonType = 0
buttonDescription = ""
for button in self.buttons:
if button[1].within(position):
match = True
buttonType = button[0]
buttonDescription = button[2]
break
return (match, buttonType, buttonDescription)
# Return a facit description name.
def getSideDescription(self):
return self.sideName
# Return a button description string according to the facit type.
def buttonDescription(self, buttonType):
for button in self.buttons:
if button[0] == buttonType:
return button[2]
# A cube in memory, stores and interacts with the cube used on the command deck.
class Cube(object):
def __init__(self):
self.sides = [CubeSide(), CubeSide(), CubeSide(),
CubeSide(), CubeSide(), CubeSide()]
self.currentSide = 0 # In crew role order.
self.oldFacet = 0 # previous facet
self.spinPosition = 0 # Where are we for a spin?
self.cubeSpinQueue = [] # Queue of targets we spin through.
# Are we spinning the cube? (can't interact.)
self.cubeSpinning = False
self.cubeSpinEnd = int((g.width/320)*50)
# Determine the x,y position of the facet when drawn.
self.relativePosition = (int((g.width/320)*214),
int((g.height/200)*145))
# Check to see if the cube has had a button pressed.
def checkSideButton(self, position):
cubePositionX = position[0] - self.relativePosition[0]
cubePositionY = position[1] - self.relativePosition[1]
return self.sides[self.currentSide].checkButtonPress((cubePositionX,
cubePositionY))
# Initiate a facet change.
# ToDo: Add spin logic.
def changeFacet(self, newFacet):
self.oldFacet = self.currentSide
self.currentSide = newFacet
# Load and parse cube definition data. This populates the 5 sides with
# their button positions and return numbers.
def loadCubeData(self, file):
cubeFacetFile = io.open(file, "r")
temp = [""]
# Clear file comment lines.
while temp[0] != "BEGINCUBE":
temp[0] = cubeFacetFile.readline().split('\n')[0]
temp = (cubeFacetFile.readline().split(
'\n')[0]).split('\t') # Data Line
# Add description text to facets.
while temp[0] != "ENDDESC":
# print(temp)
try:
self.sides[int(temp[0])].updateSideName(temp[1])
except:
print("Absolutely fatal Error loading cube description data!")
temp = (cubeFacetFile.readline().split(
'\n')[0]).split('\t') # Data Line
temp = (cubeFacetFile.readline().split(
'\n')[0]).split('\t') # Data Line
# Add buttons to facets.
while temp[0] != "ENDF":
# print(temp)
try:
self.sides[int(temp[0])].addButton(int(temp[1]), int(temp[2]),
int(temp[3]), int(temp[4]),
int(temp[5]), str(temp[6]))
except:
print("Absolutely fatal Error loading cube data!")
temp = (cubeFacetFile.readline().split(
'\n')[0]).split('\t') # Data Line
# Run construction routine, this makes an actual memory cube.
def constructCube(self, file):
self.loadCubeData(file)
layout = [[0, 1, 2, 3, 4],
[1, 5, 2, 0, 4],
[2, 5, 3, 0, 1],
[3, 5, 4, 0, 2],
[4, 5, 1, 0, 3],
[5, 1, 4, 3, 2]]
# link all six sides.
for side in layout:
self.sides[side[0]].top = side[1]
self.sides[side[0]].right = side[2]
self.sides[side[0]].bottom = side[3]
self.sides[side[0]].left = side[4]
# Store the current position of a subFunction, and which it is.
class SubFunction(object):
def __init__(self, functionType, positionX, positionY):
self.functionType = functionType
self.active = True
self.positionX = positionX
self.positionY = positionY
# The main command deck of the IronSeed. All areas ultimately come here.
class CommandDeck(object):
def __init__(self, ship, crew):
self.ironSeed = ship
self.crewMembers = crew
self.commandStage = 0 # What stage of setup/interaction are we at.
self.systemState = 10
self.musicState = False
self.ironSeedTime = g.gameDate.getGameTime()
self.timePixelIncrement = 0 # For planet rotation.
self.planetRenderTime = 0
self.cube = Cube()
self.theCube = [0, 1, 2, 3, 4, 5, 6] # Cube function shortcut.
self.cubeGraphic = [0, 1, 2, 3, 4, 5, 6] # Cube graphic shortcuts.
self.cubeFirstDraw = True # Are we still drawing the cube with lasers?
self.cubeFirstDrawIncrement = 0
self.cubeFirstDrawBuffer = None
self.cubeFirstDrawXY = (0, 0)
self.subFunctions = [] # sub-functions in operation.
self.buttons = [] # Command deck buttons, not on cube.
self.cubeFocusText = "" # Title of what we are mousing over on cube.
# Load Graphics Layers
self.mainCubeGraphic = pygame.image.load(
os.path.join('Graphics_Assets', 'main-cube.png'))
# Sub-Divide cube graphics into correct groups.
self.psychoGraphic = pygame.Surface((50, 44), 0)
self.psychoGraphic.blit(self.mainCubeGraphic, (0, 0), (0, 0, 50, 44))
self.psychoGraphicScaled = pygame.transform.scale(
self.psychoGraphic, (int((g.width/320)*50), int((g.height/200)*44)))
self.cubeGraphic[0] = self.psychoGraphicScaled
self.engineeringGraphic = pygame.Surface((50, 44), 0)
self.engineeringGraphic.blit(
self.mainCubeGraphic, (0, 0), (0, 45, 50, 44))
self.engineeringGraphicScaled = pygame.transform.scale(
self.engineeringGraphic, (int((g.width/320)*50), int((g.height/200)*44)))
self.cubeGraphic[1] = self.engineeringGraphicScaled
self.scienceGraphic = pygame.Surface((50, 44), 0)
self.scienceGraphic.blit(self.mainCubeGraphic, (0, 0), (0, 90, 50, 44))
self.scienceGraphicScaled = pygame.transform.scale(
self.scienceGraphic, (int((g.width/320)*50), int((g.height/200)*44)))
self.cubeGraphic[2] = self.scienceGraphicScaled
self.securityGraphic = pygame.Surface((50, 44), 0)
self.securityGraphic.blit(
self.mainCubeGraphic, (0, 0), (0, 135, 50, 44))
self.securityGraphicScaled = pygame.transform.scale(
self.securityGraphic, (int((g.width/320)*50), int((g.height/200)*44)))
self.cubeGraphic[3] = self.securityGraphicScaled
self.astrogationGraphic = pygame.Surface((50, 44), 0)
self.astrogationGraphic.blit(
self.mainCubeGraphic, (0, 0), (0, 180, 50, 44))
self.astrogationGraphicScaled = pygame.transform.scale(
self.astrogationGraphic, (int((g.width/320)*50), int((g.height/200)*44)))
self.cubeGraphic[4] = self.astrogationGraphicScaled
self.medicalGraphic = pygame.Surface((50, 44), 0)
self.medicalGraphic.blit(self.mainCubeGraphic,
(0, 0), (0, 225, 50, 44))
self.medicalGraphicScaled = pygame.transform.scale(
self.medicalGraphic, (int((g.width/320)*50), int((g.height/200)*44)))
self.cubeGraphic[5] = self.medicalGraphicScaled
# Set cube pixel count, based on area of one side.
self.cubePixelCount = (int((g.width/320)*50)-1) * (int((g.height/200)*44)-1)
# Stars for background.
self.starBackground = pygame.image.load(
os.path.join('Graphics_Assets', 'cloud.png'))
# Prepare Stars for blitting.
self.starBackgroundScaled = pygame.transform.scale(
self.starBackground, (g.width, g.height))
# Command Deck Graphic
self.commandDeckGraphic = pygame.image.load(
os.path.join('Graphics_Assets', 'main.png'))
# Prepare Command Deck Graphic for blitting
self.commandDeckGraphicScaled = pygame.transform.scale(
self.commandDeckGraphic, (g.width, g.height))
# prepare major command deck buttons.
# Choose Psychometry
self.buttons.append((0, buttons.Button(int((g.height/200)*9),
int((g.width/320)*23),
(int((g.width/320)*183),
int((g.height/200)*149)))))
# Choose Engineering
self.buttons.append((1, buttons.Button(int((g.height/200)*9),
int((g.width/320)*23),
(int((g.width/320)*183),
int((g.height/200)*161)))))
# Choose Science
self.buttons.append((2, buttons.Button(int((g.height/200)*9),
int((g.width/320)*23),
(int((g.width/320)*183),
int((g.height/200)*173)))))
# Choose Security
self.buttons.append((3, buttons.Button(int((g.height/200)*9),
int((g.width/320)*23),
(int((g.width/320)*274),
int((g.height/200)*149)))))
# Choose Astrogation
self.buttons.append((4, buttons.Button(int((g.height/200)*9),
int((g.width/320)*23),
(int((g.width/320)*274),
int((g.height/200)*161)))))
# Choose medical
self.buttons.append((5, buttons.Button(int((g.height/200)*9),
int((g.width/320)*23),
(int((g.width/320)*274),
int((g.height/200)*173)))))
# Choose
# Position where the date and time should be printed
self.timePosition = (int((g.width/320)*45), int((g.height/200)*194))
# Position where the description text for command buttons should be
# printed.
self.descriptionPosition = (int((g.width/320)*192),
int((g.height/200)*125))
# Planet prerender ; placeholder
self.planetPrerender = object
# The cube for interaction is fairly involved, it has major functions
# which take the player to a seperate screen and therefore class.
# However, the sub-functions can act as overlay windows on the command
# deck window.
# TODO: Sub-Function list and calls.
# check to see if a sub-function is active.
def subFunctionCheck(self, subFunction):
result = False
for check in self.subFunctions:
if check.functionType == subFunction:
if check.active:
result = True
break
return result
# Deactivate a sub-function.
def subFunctionDeactivate(self, subFunction):
for check in self.subFunctions:
if check.subFunction == subFunction:
check.active = False
# Activate a sub-function.
# Note: Original game has only 1 window at a time.
# Feature Enhancement: Multiple windows with widgets,
# hey, it worked for Windows 3.11!
def subFunctionActivate(self, subFunction):
if subFunction not in self.subFunctions:
randX = int((g.width/200)*random.randint(30, 100))
randY = int((g.height/200)*random.randint(30, 100))
self.subFunctions.append(SubFunction(subFunction, randX, randY))
# Interactive panel 0: Psychometry.
def cubePsycho(self, currentButton):
state = self.systemState
# Psy Eval
if currentButton == 1:
state = 9
# Crew Status
elif currentButton == 2:
state = 13
# Planet Comm
# TODO: Evaluate if comms possible first.
elif currentButton == 3:
state = 14
# Ship Hail
# TODO: Evaluate if ship comms possible.
elif currentButton == 4:
# if ship comms possible
# state = 6
# else:
# do nothing.
pass
# Research
# TODO: Activate research routine for team.
elif currentButton == 5:
pass
# Crew Comm
elif currentButton == 6:
state = 8
return state
# Interactive Panel 1: Engineering.
def cubeEngineering(self, currentButton):
state = self.systemState
# Damage control - Sub-Function.
if currentButton == 1:
pass
# Shields - Sub-Function
elif currentButton == 2:
pass
# Weapons - Sub-Function
elif currentButton == 3:
pass
# Configure - Sub-Function
elif currentButton == 4:
pass
# Ship Logs
elif currentButton == 5:
# state = 15
pass
# Research
# TODO: Activate research routine for team.
elif currentButton == 6:
pass
# Bot Control - Sub-Function
elif currentButton == 7:
pass
# Creation
elif currentButton == 8:
# state = 16
pass
# Cargo
elif currentButton == 9:
state = 4
return state
# Interactive Panel 2: Science.
def cubeScience(self, currentButton):
state = self.systemState
# Short Range - Sub-Function
if currentButton == 1:
pass
# Long Range - Sub-Function
elif currentButton == 2:
pass
# System Info - Sub-Function
elif currentButton == 3:
pass
# Planet Scan
elif currentButton == 4:
state = 5
# Research
# TODO: Activate research routine for team.
elif currentButton == 5:
pass
# Star Logs - Sub-Function
elif currentButton == 6:
pass
return state
# Interactive Panel 3: Security.
# Note: Not really sub-functions, are ship state changers.
def cubeSecurity(self, currentButton):
state = self.systemState
# Retreat - Attempt to run away
if currentButton == 1:
pass
# Shields - Raise Shields (yellow alert?)
elif currentButton == 2:
pass
# Weapons - Activate Weapons (red alert?)
elif currentButton == 3:
pass
# Masking - Electronic masking, evasion, silent running (grey alert?)
elif currentButton == 4:
pass
# Research
# TODO: Activate research routine for team.
elif currentButton == 5:
pass
# Drones - combat practice.
# Attack - Real combat.
# Note: populate combat queue before entry.
# Note: Avoid gameover bug with drones.
elif currentButton in [6, 7]:
# state = 7
pass
return state
# Interactive Panel 4: Astrogation.
def cubeAstrogation(self, currentButton):
state = self.systemState
# Star Map - Sub-Function
if currentButton == 1:
pass
# Sector Map
elif currentButton == 2:
# state = 17
pass
# History Map - Sub-Function
elif currentButton == 3:
pass
# Quick Stats - Sub-Function
elif currentButton == 4:
pass
# Target - Sub-Function
elif currentButton == 5:
pass
# Research
# TODO: Activate research routine for team.
elif currentButton == 6:
pass
# Ship Status - Sub-Function
elif currentButton == 7:
pass
# Local Info - Sub-Function
elif currentButton == 8:
pass
return state
# Interactive Panel 5: Medical.
def cubeMedical(self, currentButton):
state = self.systemState
# Game Options - Sub-Function
# Note: This really should be an option on the game main menu.
if currentButton == 1:
pass
# Time burst - accelerate game clock ticks.
elif currentButton == 2:
pass
# clear screen - Clear all Sub-Functions, gently.
elif currentButton == 3:
for check in self.subFunctions:
self.subFunctionDeactivate(check.subFunction)
# Save - Sub-Function
elif currentButton == 4:
pass
# Load - Sub-Function
elif currentButton == 5:
pass
# TODO: Activate research routine for team.
elif currentButton == 6:
pass
# Encode - Sub-Function
elif currentButton == 7:
pass
# Decode - Sub-Function
elif currentButton == 8:
pass
# Exit - Quit from the game violently.
elif currentButton == 9:
sys.exit()
return state
# Populate cube function shortcuts.
def cubeFunctionLoading(self):
self.theCube[0] = self.cubePsycho
self.theCube[1] = self.cubeEngineering
self.theCube[2] = self.cubeScience
self.theCube[3] = self.cubeSecurity
self.theCube[4] = self.cubeAstrogation
self.theCube[5] = self.cubeMedical
# Mouse button interaction routine.
# TODO: Lots of button support.
def interact(self, mouseButton):
currentPosition = pygame.mouse.get_pos()
cubeCheck = self.cube.checkSideButton(currentPosition)
if cubeCheck[0]:
self.systemState = self.theCube[self.cube.currentSide](cubeCheck[1])
self.cubeFocusText = cubeCheck[2]
# Debug.
print("Cube Check: ", cubeCheck[0], " State: ", cubeCheck[1], "NAME: ", cubeCheck[2])
# self.systemState = self.theCube[self.cubeFacet](currentPosition)
# Check buttons for cube facets.
for button in self.buttons:
changeFacet = button[1].within(currentPosition)
if changeFacet:
self.cube.changeFacet(button[0])
self.cubeFocusText = self.cube.sides[self.cube.currentSide].getSideDescription()
# Debug
print("Focus Text: ", self.cubeFocusText)
break
return self.systemState
# Spinning the cube between facets is a trapezoidal transformation.
# Note: only see two surfaces at any one time, no isomeric view.
def drawCubeSpin(self):
pass
# If we are drawing the cube for the first time, then we need to draw
# it pixel by pixel, with a laser line from the centre of its location.
def drawCubeFirstTime(self):
sprayedResult, self.cubeFirstDrawBuffer, self.cubeFirstDrawXY = h.drawSprayFrame(self.cubeGraphic[self.cube.currentSide],
(int(self.psychoGraphicScaled.get_width()/2),
int(self.psychoGraphicScaled.get_height()/2)),
self.cubeFirstDrawIncrement,
self.cubeFirstDrawBuffer,
True,
self.cubeFirstDrawXY)
return sprayedResult
# Draw command deck interface.
# Note: The cube draws itself in at the start using multiple lasers.
def drawInterface(self, displaySurface):
displaySurface.fill(g.BLACK)
# Draw the starfield background:
displaySurface.blit(self.starBackgroundScaled, (0, 0))
# Draw planet.
#currentPlanet = planets.PlanetarySystems[self.ironSeed.getSystem()].getPlanetAtOrbit(self.ironSeed.getOrbit())
currentPlanet = self.ironSeed.getPlanet()
# Render planet here, if not already prerendered.
if self.planetRenderTime != self.ironSeedTime[3]:
readyPlanet = pygame.Surface((g.planetWidth, g.planetHeight), 0)
readyPlanet.set_colorkey(g.BLACK)
self.planetRenderTime = self.ironSeedTime[3]
terrainStart = int(self.timePixelIncrement % (g.planetWidth+1))
self.timePixelIncrement += 1
if self.timePixelIncrement > g.planetWidth+1:
self.timePixelIncrement = 0
self.planetPrerender = currentPlanet.planetBitmapToSphere(readyPlanet, terrainStart, eclipse=True)
displaySurface.blit(self.planetPrerender, (int(g.width/16), int(g.height/8)))
# render the command deck.
displaySurface.blit(self.commandDeckGraphicScaled, (0, 0))
# Draw the cube if it is the first time entering the deck.
if self.cubeFirstDraw:
displaySurface.blit(self.drawCubeFirstTime(),
(self.cube.relativePosition[0],
self.cube.relativePosition[1]))
self.cubeFirstDrawIncrement += 1
if self.cubeFirstDrawXY[0] >= (self.psychoGraphicScaled.get_width() - 1):
self.cubeFirstDraw = False
else:
# TODO: check frames and drawing of spinning cube.
# Simply draw current cube side for now.
displaySurface.blit(self.cubeGraphic[self.cube.currentSide],
(self.cube.relativePosition[0],
self.cube.relativePosition[1]))
# Draw the current date and time on the lower left log screen.
# return [self.starDateYear, self.starDateMonth, self.starDateDay,
# self.starDateHour, self.starDateMinute]
# Format is 2-digit-Day/2-digit-Month/5-digit-Year[space]hours:minutes.
h.renderText([str(g.gameDate)], g.font, displaySurface, g.BLUE,
0, self.timePosition[0], self.timePosition[1])
# Draw the current description of what has been clicked/focussed
# to the text field above the command cube.
h.renderText([self.cubeFocusText], g.font2, displaySurface, g.BLUE,
0, self.descriptionPosition[0],
self.descriptionPosition[1])
# Check stage and run routines for initialization, ongoing ops or exit.
def runCommandDeck(self, displaySurface):
if self.commandStage == 0:
# We need to ensure our system state is set.
self.systemState = 10
# Start deck music
if self.musicState == False:
pygame.mixer.music.load(os.path.join('sound', 'SECTOR.OGG'))
pygame.mixer.music.play()
self.musicState = True
self.commandStage += 1
# Construct the cube.
self.cube.constructCube(os.path.join('Data_Generators', 'Other', 'IronPy_CubeFacets.tab'))
self.cubeFunctionLoading()
# We default to side 0 for the description at the start.
self.cubeFocusText = self.cube.sides[0].getSideDescription()
elif self.commandStage == 1:
self.ironSeedTime = g.gameDate.getGameTime()
self.drawInterface(displaySurface)
# rewind and start music playing again if track end reached.
if not pygame.mixer.music.get_busy():
pygame.mixer.music.play()
if self.systemState != 10:
self.commandStage = 0
self.musicState = False
return self.systemState # loop for the moment.
# Update tick for the command deck.
def update(self, displaySurface):
return self.runCommandDeck(displaySurface)