Skip to content

Commit

Permalink
Update soldier_rifle.py
Browse files Browse the repository at this point in the history
  • Loading branch information
STINKpython authored Jan 4, 2023
1 parent 12bb153 commit c3fd4bb
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions soldier_rifle.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class Soldier_rifle:
def __init__(self,x,y):

# Animaciones
self.run = Auxiliar.getSurfaceFromSpriteSheet("imegenes/soldier/run and point.png",8,1,False,1,1)[:6]
self.atack = Auxiliar.getSurfaceFromSpriteSheet("imegenes/soldier/run and point.png",8,1,False,1,1)[6:8]
self.run = Auxiliar.getSurfaceFromSpriteSheet("unidades/soldier/run and point.png",8,1,False,1,1)[:6]
self.atack = Auxiliar.getSurfaceFromSpriteSheet("unidades/soldier/run and point.png",8,1,False,1,1)[6:8]
self.frame = 0
self.animation = self.run
self.image = self.animation[self.frame]
Expand All @@ -28,22 +28,17 @@ def move_x(self):
def move_y(self):
self.rect.y += 0

def actions(self,delta_ms,lista_eventos,enemigo):
def actions(self,delta_ms,lista_eventos):

if self.rect_radar.colliderect(enemigo):
self.animation=self.atack

else:

self.animation=self.run
self.move_x()
self.animation=self.run
self.move_x()


def update(self,delta_ms,lista_eventos,enemigo):
def update(self,delta_ms,lista_eventos):
self.tiempo_transcurrido = 0

if self.live:
self.actions(delta_ms,lista_eventos,enemigo)
self.actions(delta_ms,lista_eventos)
self.tiempo_transcurrido += delta_ms

if self.tiempo_transcurrido > self.frame_rate_ms:
Expand All @@ -56,4 +51,4 @@ def draw(self,screen):

if self.live:
self.image = self.animation[self.frame]
screen.blit(self.image,self.rect)
screen.blit(self.image,self.rect)

0 comments on commit c3fd4bb

Please sign in to comment.