def spawn(FPS, totalframes, SCREENWIDTH, SCREENHEIGHT): #AutoSpawn Flies interval = FPS * 2 boss_interval = FPS * 25 r = randint(1, 3) #Random X coordinate t = randint(1, 3) #Random Fly Image s = randint(1, 3) #Random Y coordinate x, y = 10, 350 if t == 1: img = "Images/fly1.png" elif t == 2: img = "Images/fly2.png" else: img = "Images/fly3.png" boss_img = "Images/boss.png" if r == 2: x = 1205 elif r == 3: x = 590 if s == 2: y = 450 elif s == 3: y = 250 if totalframes % interval == 0: classes.Fly(x, y, img) if totalframes == boss_interval: classes.Boss(SCREENWIDTH - 245, SCREENHEIGHT - 250, boss_img)
def spawn(FPS, total_frames, bug): five_seconds = FPS * 5 if total_frames % five_seconds == 0 and bug.spawn <= 6: x = 640 - 64 y = random.randint(30, 360 - 70) #classes.Fly(x,y,'e_f1.png') bug.spawn += 1 if classes.period.sp == 1: classes.Fly(x, y, 'chopper/chopper1.gif') elif classes.period.sp == 2: classes.Fly(x, y, 'extras/e_f1.png') elif classes.period.sp == 3: classes.Fly(x, y, 'extras/alien10001.png')
def spawn(FPS, totoal_frams): time_to_make_newFly = FPS * 3 if totoal_frams % time_to_make_newFly == 0: r = random.randint(1, 2) x = 1 if r == 2: x = 640 - 40 fly = classes.Fly(x, 130, "images\\fly.png")
def spawn(FPS, total_frames): if total_frames % FPS == 0: r = random.randint(1, 2) x = 1 if r == 2: x = 640 - 40 classes.Fly(x, 130, 40, 35, "./images/fly.png")
def spawn2(FPS, total_frames, bug): five_seconds = FPS * 5 if total_frames % five_seconds == 0 and bug.spawn == 0: x = 640 - 64 y = random.randint(30, 360 - 70) #classes.Fly(x,y,'e_f1.png') bug.spawn += 1 if classes.period.sp == 4: classes.Fly(x, y, 'spacenew1/speedship.png') elif classes.period.sp == 5: classes.Fly(x, y, 'spacenew1/smallfreighterspr.png') elif classes.period.sp == 6: classes.Fly(640 - 120, 180, 'spacenew1/heavyfreighter.png')
def spawn(FPS,total_frames): four_seconds = FPS*4 if total_frames%four_seconds==0: r=random.randint(1,2) x=1 if r==2: x=640-100 classes.Fly(x,130,"images/fly.png")