This commit is contained in:
Frank DeMarco 2014-04-26 20:26:09 +09:00
parent 37fd08b4e9
commit fd4fe2c416
2 changed files with 16 additions and 13 deletions

2
config
View File

@ -5,6 +5,6 @@ dimensions = 420, 700
quit = K_ESCAPE
[interpolate]
scale = C 0.0 24.0, 850.0 110.0
scale = C 0.0 40.0, 850.0 120.0
shift = C 0.0 0.0, 500.0 3.5, 1000.0 6.0
shift-2 = C 0.0 0.0, 840.0 4.2, 2000.0 8.0

View File

@ -142,7 +142,7 @@ class Sieve(Strip):
if self.location.bottom < acid.ry[0]:
self.vshifts[self.UP].time = 0
for location in self.locations:
location.top = acid.ry[0]
location.bottom = acid.ry[0]
elif self.location.bottom > acid.get_level():
self.vshifts[self.DOWN].time = 0
for location in self.locations:
@ -196,20 +196,23 @@ class Triangles(GameChild, list):
self.set_next_gap()
def set_next_gap(self):
self.next_gap = randint(128, 382)
self.next_gap = randint(202, 368)
def update(self):
self.populate()
if self[0].location.collidelist(self.parent.sieve.locations) != -1:
sieve = self.parent.sieve
print sieve.bar_rects, self[0].collision_rects
for br in sieve.bar_rects:
for tr in self[0].collision_rects:
if tr.move((self[0].location.left,
0)).colliderect(br.move((sieve.location.left,
0))):
print "collision"
self.remove(self[0])
if self[0].location.colliderect(sieve.electric.location):
print "pass"
self.remove(self[0])
else:
for br in sieve.bar_rects:
for tr in self[0].collision_rects:
if tr.move((self[0].location.left,
0)).colliderect(br.move((sieve.location.left,
0))):
self.remove(self[0])
break
for triangle in self:
triangle.update()
@ -229,7 +232,7 @@ class Triangle(Sprite):
surface.set_colorkey((0, 0, 0))
x = 0
height = surface.get_height()
margin = 12
margin = 26
self.collision_rects = collision_rects = []
for width in widths:
x += sieve.bar_w
@ -246,7 +249,7 @@ class Triangle(Sprite):
acid = self.get_game().acid
ratio = 1 - (self.get_game().sieve.location.bottom - acid.ry[0]) / \
float(acid.ry[1] - acid.ry[0])
self.move(dy=3 * ratio + .5)
self.move(dy=2.8 * ratio + 1)
for rect in self.collision_rects:
rect.bottom = self.location.bottom
Sprite.update(self)