65dc738f4e70852da5ada3a3cacc94711d27ee05
1 from pmachines
.scene
import Scene
2 from pmachines
.items
.box
import Box
, HitStrategy
3 from pmachines
.items
.shelf
import Shelf
15 self
.items
+= [Box(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, count
=3)]
16 #self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
17 self
.items
+= [Shelf(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, mass
=0, pos
=(.46, 0, -3.95))]
18 self
.items
+= [Shelf(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, mass
=0, pos
=(4.43, 0, -3.95))]
19 self
.items
+= [Shelf(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, mass
=0, pos
=(-1.29, 0, .26), r
=28.45)]
20 self
.items
+= [Shelf(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, mass
=0, pos
=(2.15, 0, -1.49), r
=28.45)]
21 self
.items
+= [Box(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(-1.55, 0, 1.23), friction
=.4)]
22 self
.items
+= [Box(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(4.38, 0, -3.35))]
23 self
.items
[-1].set_strategy(HitStrategy(self
.items
[-2], self
.items
[-1].node
, self
.items
[-1]._world
))
24 #self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=2)]
25 #self.items += [TargetDomino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(-1.14, 0, -.04), tgt_degrees=60)]
26 #self.items += [TargetDomino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(-.49, 0, -.04), tgt_degrees=60)]
27 #self.items += [TargetDomino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(0.94, 0, -.04), tgt_degrees=60)]
28 #self.items += [TargetDomino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(1.55, 0, -.04), tgt_degrees=60)]
29 #self.items += [TargetDomino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(2.09, 0, -.04), tgt_degrees=88)]
30 #self.items += [Basketball(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
31 #self.items += [TeeterTooter(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
33 def _define_test_items(self
):
34 self
._pos
_mgr
.register('drag_start_0', (65, 60))
35 self
._set
_test
_item
('drag_stop_0', (.42, -3.29))
36 self
._set
_test
_item
('drag_stop_1', (.42, -2.18))
37 self
._set
_test
_item
('drag_stop_2', (.35, -1.06))
40 txt
= _('Scene: ') + self
.name() + '\n\n'
41 txt
+= _('Goal: the left box must hit the right box\n\n')
42 txt
+= _('keep \5mouse_l\5 pressed to drag an item\n\n'
43 'keep \5mouse_r\5 pressed to rotate an item')
46 def _win_condition(self
):
47 return all(itm
.strategy
.win_condition() for itm
in self
.items
) and not self
._paused