Fix standing enemies collision
This commit is contained in:
+6
-2
@@ -8,6 +8,7 @@ import random
|
||||
import os
|
||||
|
||||
from Enemy import Enemy
|
||||
from CollisionBox import CollisionBox
|
||||
|
||||
|
||||
class StandingEnemy(Enemy):
|
||||
@@ -73,9 +74,9 @@ class StandingEnemy(Enemy):
|
||||
image.set_colorkey((255,0,255))
|
||||
|
||||
|
||||
self.subtype = random.randint(1, len(StandingEnemy.images))
|
||||
self.subtype = random.randint(0, len(StandingEnemy.images) - 1)
|
||||
|
||||
self.image = random.choice(StandingEnemy.images[self.subtype-1])
|
||||
self.image = random.choice(StandingEnemy.images[self.subtype])
|
||||
|
||||
# if self.subtype == 1: self.image = pygame.Surface((32, 96))
|
||||
# elif self.subtype == 2: self.image = pygame.Surface((32, 64))
|
||||
@@ -91,4 +92,7 @@ class StandingEnemy(Enemy):
|
||||
self.rect.center = (mainGameClass.getScreenWidth() + self.rect.width,
|
||||
self.height)
|
||||
|
||||
collision = CollisionBox(9, 3, self.rect.w - 18, self.rect.h - 6, self.rect.center)
|
||||
self.collisionBoxes.add(collision)
|
||||
|
||||
self.speed = self.thisGame.getGameSpeed()
|
||||
|
||||
Reference in New Issue
Block a user