From: Simon Cross Date: Sun, 11 Sep 2016 21:23:28 +0000 (+0200) Subject: Replace pygame.math which is not supported by pygame-cffi yet. X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=f6fcfa2cdf897291f3a49a22edbb2aad13870fb2;p=tabakrolletjie.git Replace pygame.math which is not supported by pygame-cffi yet. --- diff --git a/tabakrolletjie/obstacles.py b/tabakrolletjie/obstacles.py index 071ca9f..5524717 100644 --- a/tabakrolletjie/obstacles.py +++ b/tabakrolletjie/obstacles.py @@ -6,7 +6,6 @@ import pymunk import pymunk.pygame_util import pygame.draw import pygame.surface -from pygame.math import Vector2 from .constants import (SCREEN_SIZE, OBSTACLE_CATEGORY) from .loader import loader @@ -87,10 +86,10 @@ class Shrub(BaseObstacle): def __init__(self, shrublets): super(Shrub, self).__init__() for (x, y, r) in shrublets: - vec = Vector2(0, int(r)) + vec = pymunk.Vec2d(0, int(r)) STEPS = 18 vertices = [ - vec.rotate(angle) + (x, y) + vec.rotated_degrees(angle) + (x, y) for angle in range(0, 360, 360/STEPS)] vertices = [(v.x, v.y) for v in vertices]