MCPcopy Create free account
hub / github.com/ActiveState/code / CreateEnemy2

Function CreateEnemy2

recipes/Python/580636_Space_Assault/recipe-580636.py:459–476  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

457 created = 1
458
459 def CreateEnemy2():
460 global Xpos
461 global Ypos
462 global en2Xpos
463 global en2Ypos
464 global created2
465 en2Xpos = random.randrange(0,33)*25
466 en2Ypos = random.randrange(0,27)*25
467 while abs(Xpos - en2Xpos) <= 75 and abs(Ypos - en2Ypos) <= 75:
468 en2Xpos = random.randrange(0,33)*25
469 en2Ypos = random.randrange(0,27)*25
470 self.enemy2 = Canvas(self,bg="black",highlightthickness=0,width=30,height=30)
471 self.enemy2.place(x=en2Xpos,y=en2Ypos)
472 self.enemy2.create_polygon(15,0,30,30,15,15,0,30,15,0,fill="red")
473 Enemies2.append(self.enemy2)
474 Enemies2Xpos.append(en2Xpos)
475 Enemies2Ypos.append(en2Ypos)
476 created2 = 1
477
478 def CreateEnemy3():
479 global Xpos

Callers

nothing calls this directly

Calls 2

placeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected