Skip to content

Commit

Permalink
Fixes to physics engine, and sprites.
Browse files Browse the repository at this point in the history
  • Loading branch information
pvcraven committed May 2, 2016
1 parent bfe4b18 commit 1f0a906
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion arcade/physics_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def update(self):
if platform.change_x > 0:
platform.change_x *= -1

if arcade.check_for_collision(self.player_sprite, platform):
if check_for_collision(self.player_sprite, platform):
if platform.change_x < 0:
original_location = self.player_sprite.right
self.player_sprite.right = platform.left
Expand Down
17 changes: 10 additions & 7 deletions arcade/sprite.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def get_points(self):
"""
Get the corner points for the rect that makes up the sprite.
"""
if self._point_list_cache is not None and self.can_cache:
if self._point_list_cache is not None:
return self._point_list_cache

if self._points is not None:
Expand Down Expand Up @@ -419,26 +419,29 @@ def _get_center_x(self):
return self._center_x

def _set_center_x(self, new_value):
self._center_x = new_value
self._point_list_cache = None
if new_value != self._center_x:
self._center_x = new_value
self._point_list_cache = None

center_x = property(_get_center_x, _set_center_x)

def _get_center_y(self):
return self._center_y

def _set_center_y(self, new_value):
self._center_y = new_value
self._point_list_cache = None
if new_value != self._center_y:
self._center_y = new_value
self._point_list_cache = None

center_y = property(_get_center_y, _set_center_y)

def _get_angle(self):
return self._angle

def _set_angle(self, new_value):
self._angle = new_value
self._point_list_cache = None
if new_value != self._angle:
self._angle = new_value
self._point_list_cache = None

angle = property(_get_angle, _set_angle)

Expand Down

0 comments on commit 1f0a906

Please sign in to comment.