2 # this is the Entity class
7 print "Entity class...more documentation to come"
11 def __init__(self
, engine
, specs
):
15 if specs
.has_key('script'):
17 self
.script
= engine
.readZipfile(specs
['script'])
20 print "Entity.__init__(): Couldn't find/exec script"
22 assert specs
.has_key('name')
23 self
.name
= specs
['name']
25 if specs
.has_key('model'):
27 self
.data
= read_3ds_mem(engine
.readZipfile(specs
['model']), 1, 1)
29 # print "Entity.__init__(): Error reading model"
31 def draw(self
, engine
):
37 def event(self
, event
, data
):
39 if self
.functions
.has_key(event
):
41 self
.functions
[event
](data
)
43 print "Entity.event(): Error running event callback"
47 if __name__
== '__main__': main()