1 from panda3d
.bullet
import BulletBoxShape
, BulletRigidBodyNode
, BulletGhostNode
2 from game
.items
.item
import Item
, StillStrategy
7 def __init__(self
, world
, plane_node
, cb_inst
, curr_bottom
, repos
, mass
=1, pos
=(0, 0, 0), r
=0, count
=0, restitution
=.5, friction
=.6):
8 super().__init
__(world
, plane_node
, cb_inst
, curr_bottom
, repos
, 'assets/models/bam/domino/domino.bam', mass
=mass
, pos
=pos
, r
=r
, count
=count
, restitution
=restitution
, friction
=friction
)
10 def _set_shape(self
, apply_scale
=True):
11 self
.node
.add_shape(BulletBoxShape((.1, .25, .5)))
14 class UpStrategy(StillStrategy
):
16 def __init__(self
, np
, tgt_degrees
):
18 self
._tgt
_degrees
= tgt_degrees
21 def win_condition(self
):
22 return super().win_condition() and abs(self
._np
.get_r()) <= self
._tgt
_degrees
25 class DownStrategy(StillStrategy
):
27 def __init__(self
, np
, tgt_degrees
):
29 self
._tgt
_degrees
= tgt_degrees
32 def win_condition(self
):
33 return self
._np
.get_z() < -6 or super().win_condition() and abs(self
._np
.get_r()) >= self
._tgt
_degrees