Пример #1
0
 def update(self, events):
     """Update Everything"""
     if not pygame.mixer.music.get_busy():
         Img.musply(choice(self.music), 1)
     for n in range(self.tran[0]):
         if not randint(0, self.tran[1]):
             rx = randint(0, self.size[0] - 1)
             ry = randint(0, self.size[1] - 1)
             terrlist[self.terr[rx][ry]].ranupdate(self, rx, ry)
     for ent in self.ents:
         ent.update(self, events)
         ent.mupdate(self, events)
     self.anitick += 1
     if self.anitick == 56:
         self.anitick = 0
         self.map = self.make_map()
     for row in self.objs:
         for obj in row:
             if obj and obj.updatable:
                 obj.update(self)
     if self.player.psupply > 0:
         for pst in self.player.pstorage:
             self.player.psupply -= pst.give_power(self, self.player.psupply)
             if self.player.psupply == 0:
                 break
Пример #2
0
# image modules
import World
import Generators
import Img
import GUI
import Tutorial

pygame.display.set_icon(Img.imgret2("Monolith.png"))
pygame.display.set_caption("monolith")
numplayers = 1
wgen = 0
pset = 0
puzzles = 0
pnum = 0
c = pygame.time.Clock()
Img.musply("Planets/1. Mars.ogg")
nland = Img.imgret("NiceLand.png")
rgb = [200, 255, 255]
tick = 0
cont = True
kp = True
# titlescreen
srect = pygame.Rect(0, 0, 0, 0)
prect = pygame.Rect(0, 0, 0, 0)
grects = []
wsizemod = 0
wsrects = []
psrects = []
godmode = False
tutorial = False
tutb = pygame.Rect(0, 0, 0, 0)