dbd1e1819cb478c86892bf9d85582e14a58f9d13
1 from panda3d
.bullet
import BulletBoxShape
2 from pmachines
.items
.item
import Item
7 def __init__(self
, world
, plane_node
, cb_inst
, curr_bottom
, repos
, json
, mass
=1, pos
=(0, 0, 0), r
=0, count
=0, restitution
=.5, friction
=.8, model_scale
=1):
8 super().__init
__(world
, plane_node
, cb_inst
, curr_bottom
, repos
, 'assets/models/bam/box/box.bam', json
, mass
=mass
, pos
=pos
, r
=r
, count
=count
, restitution
=restitution
, friction
=friction
, model_scale
=model_scale
)
10 def _set_shape(self
, apply_scale
=True):
11 self
.node
.add_shape(BulletBoxShape((.5, .5, .5)))
16 def __init__(self
, hit_by
, node
, world
):
21 def win_condition(self
):
22 for contact
in self
._world
.contact_test(self
._node
).get_contacts():
23 other
= contact
.get_node1() if contact
.get_node0() == self
._node
else contact
.get_node0()
24 if other
== self
._hit
_by
.node
: