42
45
self.lightsGroup.add(YellowSpark(self.x - 32, self.y - 32, dx, dy))
45
for s in self.blocksGroup.sprites():
46
if isinstance(s, Ice) and s.x == self.x and s.y == self.y:
48
self.resources.playSound("samples/bonus")
51
for player in self.players.sprites():
52
if player.x == self.x and player.y == self.y and not player.dead:
54
if self.canFall and not self.blockedBelow():
56
self.light.x = self.x - 32 + random.randint(-4, 4)
57
self.light.y = self.y - 32 + random.randint(-4, 4)
48
if self.followMe is not None:
50
if not self.followMe.alive():
51
#the iceblock was killed
56
self.x = self.followMe.x
57
if self.followMe.falling or not self.followMe.moving:
60
for s in pygame.sprite.spritecollide(self, self.blocksGroup, False): # usar sprite collision ?
61
if isinstance(s, Ice):
62
if s.falling and s.x == self.x and s.y == self.y:
64
self.resources.playSound("samples/bonus")
68
self.x = (prev_x+self.width/2)/32*32
70
#check world colisions
71
if self.followMe is not None:
72
if self.followMe.moving>0:
73
if self.level[(self.x+self.width)/32,(self.y+self.height/2)/32]:
77
if self.level[self.x/32,(self.y+self.height/2)/32]:
78
self.x = (self.x/32+1)*32
80
#enemies are not checked, they need to be flying enemies wich
81
#can take damage from fire.
82
self.light.x = self.x - 32 + random.randint(-4, 4)
83
self.light.y = self.y - 32 + random.randint(-4, 4)
86
for s in self.blocksGroup.sprites():
87
if isinstance(s, Ice) and s.x == self.x and s.y == self.y:
89
self.resources.playSound("samples/bonus")
92
for player in self.players.sprites():
93
if player.x == self.x and player.y == self.y and not player.dead:
95
if self.canFall and not self.blockedBelow():
97
if 9>self.level.height*30-self.y>4:
98
# fire falling out of the level, lauch seekers to kill players
99
x=self.x+self.width/2.; y=self.y; da=math.radians(360./16.)
100
for s in g_groups['players']:
103
for i in range(0,16):
104
heading = [math.cos(i*da),math.sin(i*da)]
105
g_groups['stones'].add(Seeker(x+heading[0]*4., y+heading[1]*4., heading,3.,target))
106
self.light.x = self.x - 32 + random.randint(-4, 4)
107
self.light.y = self.y - 32 + random.randint(-4, 4)