Mercurial > dw
changeset 31:139b5500c426
Delayed monster attacks, fixed shadows
| author | Radomir Dopieralski <moindev@sheep.art.pl> |
|---|---|
| date | Fri, 21 Dec 2007 03:58:58 +0100 |
| parents | 760f734672d0 |
| children | eaa6069abca6 |
| files | data/map.txt lib/monster/__init__.py lib/monster/crate.py lib/monster/jello.py main.py |
| diffstat | 5 files changed, 21 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/data/map.txt Tue Dec 18 15:26:34 2007 +0100 +++ b/data/map.txt Fri Dec 21 03:58:58 2007 +0100 @@ -3,10 +3,10 @@ . <corridor.png> > <stairs.png> M <floor.png> <jello> -S <floor.png> <jello> -B <floor.png> <jello> -Z <floor.png> <jello> -& <floor.png> <jello> +S <floor.png> <skeleton> +B <floor.png> <brain> +Z <floor.png> <zombie> +& <floor.png> <box> @ <floor.png> <player> ::::::XXXXXXXXXXXXXX
--- a/lib/monster/__init__.py Tue Dec 18 15:26:34 2007 +0100 +++ b/lib/monster/__init__.py Fri Dec 21 03:58:58 2007 +0100 @@ -96,17 +96,17 @@ self.animate(self.frames[0], 1) def anim_attack(self): - if self.step>=6: - dx = delta_x[self.facing]*6 - dy = delta_y[self.facing]*4-1 - elif self.step<=8: + if self.step<=2: dx = -delta_x[self.facing]*6 dy = -delta_y[self.facing]*4+1 self.h-=1 + elif self.step<=4: + dx = delta_x[self.facing]*6 + dy = delta_y[self.facing]*4-1 + self.h+=1 else: dx = 0 dy = 0 - self.h+=1 self.rect.move_ip(dx, dy) self.animate(self.frames[0], 0)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/monster/crate.py Fri Dec 21 03:58:58 2007 +0100 @@ -0,0 +1,8 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +from monster import Monster + +class Mob(Monster): + def __init__(self, pos, level): + Monster.__init__(self, pos, level, "box.png")
--- a/lib/monster/jello.py Tue Dec 18 15:26:34 2007 +0100 +++ b/lib/monster/jello.py Fri Dec 21 03:58:58 2007 +0100 @@ -25,7 +25,9 @@ pass def attack(self, direction, monster): - self.step = 10 + self.step = 8 self.anim = self.anim_attack monster.hit() + def hit(self): + pass
--- a/main.py Tue Dec 18 15:26:34 2007 +0100 +++ b/main.py Fri Dec 21 03:58:58 2007 +0100 @@ -3,7 +3,7 @@ import os import sys -base_path = os.path.split(os.path.abspath(__file__))[0] +base_path = os.path.split(os.path.abspath(sys.argv[0]))[0] sys.path.insert(0, os.path.join(base_path, "lib")) import game data_path = os.path.join(base_path, "data")
