forked from enricmacias/Glooveth
/
CPotatoes.py
executable file
·41 lines (33 loc) · 1.97 KB
/
CPotatoes.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
37
38
39
40
41
# Panda3D imports
from direct.gui.OnscreenImage import OnscreenImage
from pandac.PandaModules import TransparencyAttrib
# Project imports
from Image import *
from CEnemy import *
from Attack import *
# Potatoes Enemy
class CPotatoes (CEnemy):
def __init__(self, x, y, z):
CEnemy.__init__(self, x, y, z)
#-----------------------------------------------------------------------------------------------------------------------------------------------
#---------------------------------------------------VARIABLE DECLARATION------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------------------------------
self.life = 1
self.scale = (2.0,1.0,3.0)
self.bitmap = Image();
self.model = self.bitmap.loadModel("./models/Square.egg", "./tex/ePotatoes.png", self.posX, self.posY, self.posZ, self.scale)
# Sound
self.soundDeath = base.loadSfx('./sound/die2.wav')
self.soundDeath.setVolume(.5)
#end __init__
#-----------------------------------------------------------------------------------------------------------------------------------------------
#----------------------------------------------------------------FUNCTIONS----------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------------------------------
# It shoots an attack to the point where is the main character at that moment
def attack(self,mainCharX,mainCharY,mainCharZ):
char = [mainCharX,mainCharY,mainCharZ]
enemy = [self.posX,self.posY,self.posZ]
self.att = Attack("ENEMY", "POTATOES", self, char)
self.attacking = True;
#end attack
#end class CMain