projects
/
tabakrolletjie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Slow rate Boyd gets tougher
[tabakrolletjie.git]
/
tabakrolletjie
/
enemies.py
diff --git
a/tabakrolletjie/enemies.py
b/tabakrolletjie/enemies.py
index 8294f4d426502fe149c5078fc9626c93c7995594..e5381c9476b5d3da3c32710a19a7396b9675131a 100644
(file)
--- a/
tabakrolletjie/enemies.py
+++ b/
tabakrolletjie/enemies.py
@@
-12,7
+12,7
@@
from .constants import (SCREEN_SIZE, MOULD_CATEGORY, OBSTACLE_CATEGORY,
TURNIP_CATEGORY, COLOURS)
from .loader import loader
from .sound import sound
TURNIP_CATEGORY, COLOURS)
from .loader import loader
from .sound import sound
-from .transforms import Multiply
+from .transforms import Multiply
, Overlay
from .utils import debug_timer
MOULD_FILTER = pymunk.ShapeFilter(
from .utils import debug_timer
MOULD_FILTER = pymunk.ShapeFilter(
@@
-23,17
+23,17
@@
EAT_TURNIP_FILTER = pymunk.ShapeFilter(mask=TURNIP_CATEGORY)
# Boyd parameters
# Boyd parameters
-SPAWN_RATE =
10
-MAX_AGE =
6
0
+SPAWN_RATE =
5
+MAX_AGE =
3
0
MAX_ELEMENTS = 400
MAX_HEALTH = 100
# Increase in health per day
MAX_ELEMENTS = 400
MAX_HEALTH = 100
# Increase in health per day
-DAY_HEALTH =
10
+DAY_HEALTH =
5
HEAL_FACTOR = 1
HEAL_FACTOR = 1
-MOULD_STAGES = [
15, 25
]
+MOULD_STAGES = [
7, 13
]
MOULD_RADIUS = 16
MOULD_RADIUS = 16
@@
-101,7
+101,10
@@
class Mould(pymunk.Body):
if not self._eyeball:
name = random.choice(
('eyeballA.png', 'eyeballB.png', 'eyeballC.png'))
if not self._eyeball:
name = random.choice(
('eyeballA.png', 'eyeballB.png', 'eyeballC.png'))
- self._eyeball = loader.load_image("32", name)
+ self._eyeball = loader.load_image("32", name,
+ transform=Overlay(colour=self._transform.colour+(127,)))
+ eyelid = loader.load_image("32", "eyelid.png", transform=self._transform)
+ self._eyeball.blit(eyelid, (0, 0), None)
return self._eyeball
def set_health(self, new_health):
return self._eyeball
def set_health(self, new_health):
@@
-146,8
+149,8
@@
class Mould(pymunk.Body):
child._health = self._health
moulds.append(child)
refresh = True
child._health = self._health
moulds.append(child)
refresh = True
- if random.randint(0, 10
) < 2
:
- sound.play_sound("
mouth_pop_2a.ogg"
)
+ if random.randint(0, 10
0) < 1
:
+ sound.play_sound("
rubber_toy_short%d.ogg" % random.randint(1, 5), volume=0.3
)
if self._age in MOULD_STAGES:
# We grow in size
if self._age in MOULD_STAGES:
# We grow in size
@@
-157,6
+160,7
@@
class Mould(pymunk.Body):
if self._age > MOULD_STAGES[1] and random.randint(0, 500) < 1:
# Maybe we grow an eyeball
self.has_eyeball = True
if self._age > MOULD_STAGES[1] and random.randint(0, 500) < 1:
# Maybe we grow an eyeball
self.has_eyeball = True
+ sound.play_sound("mouth_pop_2a.ogg", volume=0.5)
if self._age > MAX_AGE:
# We die of old age
if self._age > MAX_AGE:
# We die of old age
@@
-170,6
+174,7
@@
class Mould(pymunk.Body):
EAT_TURNIP_FILTER)
if query:
query[0].shape.body.turnip.eaten = True
EAT_TURNIP_FILTER)
if query:
query[0].shape.body.turnip.eaten = True
+ sound.play_sound("eating_chips_%d.ogg" % random.randint(1, 3), volume=0.8)
return refresh
def damage(self, light, space, moulds):
return refresh
def damage(self, light, space, moulds):