Skip to content

Commit

Permalink
Fix missing png/wav in examples in wheels #222
Browse files Browse the repository at this point in the history
  • Loading branch information
viblo committed Jan 2, 2023
1 parent 73797ac commit 52bba36
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ recursive-include additional_examples *.ipynb
prune additional_examples/.ipynb_checkpoints
prune additional_examples/build
prune additional_examples/dist
recursive-include pymunk/examples *.png
recursive-include pymunk/examples *.wav
#chipmunk src
recursive-include Chipmunk2D/src *
recursive-include Chipmunk2D/include/chipmunk *
Expand Down
5 changes: 4 additions & 1 deletion pymunk/examples/index_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import random
import sys
import os.path

random.seed(5) # try keep difference the random factor the same each run.

Expand All @@ -34,7 +35,9 @@
pymunk.pygame_util.positive_y_is_up = False

### Generate geometry from pymunk logo image
logo_img = pygame.image.load("pymunk_logo_sphinx.png")
logo_img = pygame.image.load(
os.path.join(os.path.dirname(os.path.abspath(__file__)), "pymunk_logo_sphinx.png")
)
logo_bb = pymunk.BB(0, 0, logo_img.get_width(), logo_img.get_height())


Expand Down
9 changes: 7 additions & 2 deletions pymunk/examples/platformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import math
import sys
import os.path

import pygame

Expand Down Expand Up @@ -60,8 +61,12 @@ def main():
clock = pygame.time.Clock()
running = True
font = pygame.font.SysFont("Arial", 16)
sound = pygame.mixer.Sound("sfx.wav")
img = pygame.image.load("xmasgirl1.png")
sound = pygame.mixer.Sound(
os.path.join(os.path.dirname(os.path.abspath(__file__)), "sfx.wav")
)
img = pygame.image.load(
os.path.join(os.path.dirname(os.path.abspath(__file__)), "xmasgirl1.png")
)

### Physics stuff
space = pymunk.Space()
Expand Down
7 changes: 6 additions & 1 deletion pymunk/examples/using_sprites.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import math
import random
from typing import List
import os.path

import pygame

Expand All @@ -33,7 +34,11 @@ def main():
space.gravity = Vec2d(0.0, -900.0)

## logo
logo_img = pygame.image.load("pymunk_logo_googlecode.png")
logo_img = pygame.image.load(
os.path.join(
os.path.dirname(os.path.abspath(__file__)), "pymunk_logo_googlecode.png"
)
)
logos: List[pymunk.Shape] = []

### Static line
Expand Down
1 change: 1 addition & 0 deletions pymunk/examples/using_sprites_pyglet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import math
import random
import os.path
from typing import List

import pyglet
Expand Down

0 comments on commit 52bba36

Please sign in to comment.