-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnemy.py
36 lines (30 loc) · 885 Bytes
/
Enemy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 3 04:24:26 2018
@author: X
"""
from Item import *
import random
class enemy:
def __init__(self):
self.Name = 'enemy'
self.type = ''
#self.location=location
def setType(self):
self.type='Mark I'
class enemyList(itemList):
def generate(self,birthLoc):
yCount = 0
for y in self.map:
xCount = 0
for x in y:
if (x==1) and (yCount,xCount)!=birthLoc:
if (random.random()>self.prop):
Enemy = enemy()
Enemy.setType()
self.Dict[(yCount,xCount)]=Enemy
xCount+=1
yCount+=1
def removeEnemy(self,hasBattle,player):
if hasBattle==False:
self.Dict.pop((player.getLocation()))