-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathboost.py
More file actions
22 lines (19 loc) · 857 Bytes
/
boost.py
File metadata and controls
22 lines (19 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from direct.actor.Actor import Actor #for animated models
from direct.interval.ActorInterval import ActorInterval
from pandac.PandaModules import * #basic Panda modules
from trap import *
class boost(trap):
def __init__(self, _x, _y):
trap.__init__(self, _x, _y, "boost")
def load_model(self):
self.model = loader.loadModel("models/booster.egg")
self.model.reparentTo(render)
self.model.setScale(5.7)
self.model.setPos(self.x, self.y, 0)
self.set_up_collisions()
def set_up_collisions(self):
self.collision_sphere = CollisionSphere((4.3,4.3,0), 4)
self.collision_node = CollisionNode("boost")
self.collision_node.addSolid(self.collision_sphere)
self.collision_node_path = self.model.attachNewNode(self.collision_node)
#self.collision_node_path.show()