Skip to content

Commit

Permalink
added shard
Browse files Browse the repository at this point in the history
  • Loading branch information
whyismynamerudy committed Jan 27, 2024
1 parent 754e0a3 commit 271242b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
10 changes: 5 additions & 5 deletions board.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# 0 = empty black rectangle, 1 = dot, 2 = big dot, 3 = vertical line,
# 4 = horizontal line, 5 = top right, 6 = top left, 7 = bot left, 8 = bot right
# 9 = gate
# 9 = gate, 10 = photo_piece
boards = [
[6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5],
[3, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 3],
[3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3],
[3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 3, 3],
[3, 3, 1, 6, 4, 4, 5, 1, 6, 4, 4, 4, 5, 1, 3, 3, 1, 6, 4, 4, 4, 5, 1, 6, 4, 4, 5, 1, 3, 3],
[3, 3, 2, 3, 0, 0, 3, 1, 3, 0, 0, 0, 3, 1, 3, 3, 1, 3, 0, 0, 0, 3, 1, 3, 0, 0, 3, 2, 3, 3],
[3, 3, 1, 7, 4, 4, 8, 1, 7, 4, 4, 4, 8, 1, 7, 8, 1, 7, 4, 4, 4, 8, 1, 7, 4, 4, 8, 1, 3, 3],
[3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3],
[3, 3, 1, 6, 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4, 5, 1, 6, 4, 4, 4, 5, 1, 3, 3, 1, 6, 4, 4, 4, 5, 1, 6, 4, 4, 5, 1, 3, 3],
[3, 3, 1, 7, 4, 5, 3, 1, 7, 4, 4, 4, 8, 1, 7, 8, 1, 7, 4, 4, 4, 8, 1, 3, 6, 4, 8, 1, 3, 3],
[3, 3, 10, 7, 4, 5, 3, 1, 7, 4, 4, 4, 8, 1, 7, 8, 1, 7, 4, 4, 4, 8, 1, 3, 6, 4, 8, 1, 3, 3],
[3, 3, 2, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 2, 3, 3],
[3, 7, 4, 5, 1, 3, 3, 1, 6, 5, 1, 6, 4, 4, 4, 4, 4, 4, 5, 1, 6, 5, 1, 3, 3, 1, 6, 4, 8, 3],
[3, 6, 4, 8, 1, 7, 8, 1, 3, 3, 1, 7, 4, 4, 5, 6, 4, 4, 8, 1, 3, 3, 1, 7, 8, 1, 7, 4, 5, 3],
Expand Down
14 changes: 12 additions & 2 deletions pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
lives = 3
game_over = False
game_won = False
img_pp = pygame.image.load("photo_piece.png").convert_alpha()
img_pp = pygame.transform.scale(img_pp, (30,30))
mute = False

# Each Ghost's class, each ghost has its own movement, this can be changed to just one movement way

Expand Down Expand Up @@ -730,7 +733,11 @@ def draw_board():
2 * PI, 3)
if level[i][j] == 9:
pygame.draw.line(screen, 'white', (j * num2, i * num1 + (0.5 * num1)),
(j * num2 + num2, i * num1 + (0.5 * num1)), 3)
(j * num2 + num2, i * num1 + (0.5 * num1)), 3)
if level[i][j] == 10:
# pygame.draw.circle(screen, 'aqua', (j * num2 + (0.5 * num2), i * num1 + (0.5 * num1)), 4)
screen.blit(img_pp, (j * num2, i * num1))



def draw_player():
Expand Down Expand Up @@ -897,7 +904,8 @@ def get_targets(blink_x, blink_y, ink_x, ink_y, pink_x, pink_y, clyd_x, clyd_y):

current_time = pygame.time.get_ticks()
if current_time - last_play_time >= delay_duration:
sound.play()
if not mute:
sound.play()
last_play_time = current_time

timer.tick(fps)
Expand Down Expand Up @@ -1210,6 +1218,8 @@ def get_targets(blink_x, blink_y, ink_x, ink_y, pink_x, pink_y, clyd_x, clyd_y):
direction_command = direction
if event.key == pygame.K_DOWN and direction_command == 3:
direction_command = direction
if event.key == pygame.K_m:
mute = not mute

if direction_command == 0 and turns_allowed[0]:
direction = 0
Expand Down
Binary file added photo_piece.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 271242b

Please sign in to comment.