all repos — Legends-RPG @ 7c7eafe8cb828455b8babf01082d53a815115ff1

A fantasy mini-RPG built with Python and Pygame.

Changed player image when moving forward during attack.
Justin Armstrong justinmeister@gmail.com
Sat, 19 Apr 2014 13:07:02 -0700
commit

7c7eafe8cb828455b8babf01082d53a815115ff1

parent

200f77f62ddf5be44f661d74f36faeb4daa5ad8f

1 files changed, 6 insertions(+), 1 deletions(-)

jump to
M data/components/person.pydata/components/person.py

@@ -306,13 +306,18 @@ if self.x_vel == SLOW_BACK:

if self.rect.x >= self.origin_pos[0] + 10: self.x_vel = FAST_FORWARD elif self.x_vel == FAST_FORWARD: - if self.rect.x <= self.origin_pos[0] - 60: + if self.rect.topleft >= self.origin_pos: + self.image = self.spritesheet_dict['facing left 1'] + self.image = pg.transform.scale2x(self.image) + elif self.rect.x <= self.origin_pos[0] - 100: self.x_vel = FAST_BACK else: if self.rect.x >= self.origin_pos[0]: self.rect.x = self.origin_pos[0] self.x_vel = 0 self.state = 'battle resting' + self.image = self.spritesheet_dict['facing left 2'] + self.image = pg.transform.scale2x(self.image) self.observer.on_notify('select action')