Replace pygame.math which is not supported by pygame-cffi yet.
authorSimon Cross <hodgestar@gmail.com>
Sun, 11 Sep 2016 21:23:28 +0000 (23:23 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sun, 11 Sep 2016 21:23:28 +0000 (23:23 +0200)
tabakrolletjie/obstacles.py

index 071ca9f935c1d4cd87fec3de82e13bf6ca0f82e9..55247179088c1a339d80cabb699b8cc78bd4e0f7 100644 (file)
@@ -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]