Skip to content

Commit

Permalink
Collision objects added
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbejcek committed Mar 7, 2024
1 parent 345204e commit e2b46b8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Binary file added Images/Background/temp_bg2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Images/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


img_paths = {
"BG_image": os.path.join(current_dir, '..', 'Images', 'Background','bg.png'),
"BG_image": os.path.join(current_dir, '..', 'Images', 'Background','temp_bg2.png'),
"character_img": os.path.join(current_dir, '..', 'Images','Characters','character.png'),
"char_idle": os.path.join(current_dir,'..','Images','Characters','Player','Idle','0.png'),
"arrow_default": os.path.join(current_dir,'..', 'Images', 'Characters','Player','Arrow','Arrow.png'),
Expand Down
16 changes: 12 additions & 4 deletions Main/collisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,25 @@ def platform_collision():
platform_list = []
lamp = pygame.Rect(1002, 748, 185, 2)
floor = pygame.Rect(0, 900, 1792, 2)
roof = pygame.Rect(1348, 626, 200, 2)
right_roof = pygame.Rect(1348, 626, 200, 2)
chimney = pygame.Rect(1660, 462, 100, 2)
second_roof = pygame.Rect(1375, 350, 150, 2)
second_right_roof = pygame.Rect(1375, 350, 150, 2)
tent = pygame.Rect(511, 756, 290, 2)
sky_platform_right = pygame.Rect(958, 280, 175, 2)
sky_platform_left = pygame.Rect(555, 280, 175, 2)
sky_platform_bottom = pygame.Rect(555, 450, 175, 2)
left_roof = pygame.Rect(145, 620, 290, 2)

platform_list.append(floor)
platform_list.append(lamp)
platform_list.append(roof)
platform_list.append(right_roof)
platform_list.append(chimney)
platform_list.append(second_roof)
platform_list.append(second_right_roof)
platform_list.append(tent)
platform_list.append(sky_platform_right)
platform_list.append(sky_platform_left)
platform_list.append(sky_platform_bottom)
platform_list.append(left_roof)

return platform_list

0 comments on commit e2b46b8

Please sign in to comment.