Permalink
Browse files

final tile blocking changes, NOW im happy :)

  • Loading branch information...
1 parent 114921e commit c8f6e9944a9a099df2be195b407cc667e50d7a27 @josephbleau committed May 17, 2011
Showing with 16 additions and 3 deletions.
  1. +5 −0 editor.py
  2. BIN editor.pyc
  3. +1 −1 game.py
  4. BIN game.pyc
  5. +4 −2 run_game.py
  6. +6 −0 tile.py
  7. BIN tile.pyc
View
@@ -47,6 +47,11 @@ def place_tile(self, event):
if event.button == 1:
no, x,y,z = self.cursor_tile.tileno, self.cursor_tile.x, self.cursor_tile.y, self.cursor_tile.z
for tile in self.tiles:
+ if (tile.x + 20 == x and tile.y - 30 == y) or \
+ (tile.x - 20 == x and tile.y - 30 == y) or \
+ (tile.x + 20 == x and tile.y + 30 == y) or \
+ (tile.x - 20 == x and tile.y + 30 == y):
+ z = tile.z + 1
if tile.x == x and tile.y == y:
z = tile.z + 1
if tile.y == y and tile.x + 20 == x:
View
Binary file not shown.
View
@@ -129,7 +129,7 @@ def render(self, screen):
pygame.draw.rect(screen,(0,0,0), (0,520,800,80))
# Draw Title & Score
- render_text(screen, self.font, "Vanessa Mahjong", (20,20,300,300), color=(255,150,122))
+ render_text(screen, self.font, "Vanessa's Mahjong", (20,20,300,300), color=(255,150,122))
render_text(screen, self.font, "Pieces Removed: ", (20,540,200,100), color=(255,150,122))
render_text(screen, self.font, str(self.pieces_removed) + ' of ' + str(self.start_piece_count), (300,540,200,50), color=(255,255,255))
View
BIN game.pyc
Binary file not shown.
View
@@ -25,8 +25,10 @@ def main():
if game.state == 'next_level':
game = Game()
- screen.fill((238,221,130))
-
+ if game.state == 'playing':
+ screen.fill((238,221,130))
+ if game.state == 'level_complete':
+ screen.fill((255,255,255))
for event in pygame.event.get():
if event.type == pygame.QUIT:
return
View
@@ -26,6 +26,12 @@ def is_blocked(self,tiles):
left = False
right = False
for tile in tiles:
+ print self.x, self.y, self.z
+ if (tile.z > self.z and tile.x + 20 == self.x and tile.y - 30 == self.y) or \
+ (tile.z > self.z and tile.x - 20 == self.x and tile.y - 30 == self.y) or \
+ (tile.z > self.z and tile.x + 20 == self.x and tile.y + 30 == self.y) or \
+ (tile.z > self.z and tile.x - 20 == self.x and tile.y + 30 == self.y):
+ return True
if tile.z > self.z and tile.x + 20 == self.x and tile.y == self.y:
return True
if tile.z > self.z and tile.x - 20 == self.x and tile.y == self.y:
View
BIN tile.pyc
Binary file not shown.

0 comments on commit c8f6e99

Please sign in to comment.