Commit | Line | Data |
---|---|---|
4586cbf6 FC |
1 | from pmachines.scene import Scene |
2 | from pmachines.items.box import Box | |
3 | from pmachines.items.shelf import Shelf | |
c991401b | 4 | from pmachines.items.domino import Domino, DownStrategy |
4586cbf6 | 5 | from pmachines.items.basketball import Basketball |
10262fde FC |
6 | |
7 | ||
8 | class SceneDominoBoxBasketball(Scene): | |
9 | ||
3fe18d73 | 10 | filename = 'assets/scenes/domino_box_basketball.json' |
92c29685 | 11 | |
10262fde FC |
12 | @staticmethod |
13 | def name(): | |
14 | return _('Domino, box and basket ball') | |
15 | ||
16 | def _set_items(self): | |
10262fde FC |
17 | self.items += [Box(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=1, mass=5)] |
18 | self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=1)] | |
19 | self.items += [Basketball(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(-.3, 1, 2.5))] | |
20 | self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(-.56, 0, -1.45))] | |
21 | self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(1.67, 0, -1.45))] | |
22 | self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(3.78, 0, -1.45))] | |
045aafc4 FC |
23 | self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(1.48, 0, .38), r=-90)] |
24 | self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(2.62, 0, .05))] | |
25 | self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(4.88, 0, .05))] | |
10262fde FC |
26 | #self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=9)] |
27 | self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(1.68, 0, -.89))] | |
28 | self.items[-1].set_strategy(DownStrategy(self.items[-1]._np, 35)) | |
29 | self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(2.35, 0, -.89))] | |
30 | self.items[-1].set_strategy(DownStrategy(self.items[-1]._np, 35)) | |
31 | self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(3.08, 0, -.89))] | |
32 | self.items[-1].set_strategy(DownStrategy(self.items[-1]._np, 35)) | |
33 | self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(3.78, 0, -.89))] | |
34 | self.items[-1].set_strategy(DownStrategy(self.items[-1]._np, 35)) | |
35 | self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(4.53, 0, -.89))] | |
36 | self.items[-1].set_strategy(DownStrategy(self.items[-1]._np, 35)) | |
37 | #self.items += [Basketball(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)] | |
38 | #self.items += [TeeterTooter(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)] | |
39 | ||
da03f030 FC |
40 | # def _define_test_items(self): |
41 | # self._pos_mgr.register('drag_start_0', (65, 60)) | |
42 | # self._pos_mgr.register('drag_start_1', (30, 60)) | |
43 | # self._set_test_item('drag_stop_0', (-1.4, -.78)) | |
44 | # self._set_test_item('drag_stop_1', (-1.26, .2)) | |
45 | # self._set_test_item('drag_stop_2', (-.28, -.78)) | |
46 | # self._set_test_item('drag_start_2', (-.28, -.57)) | |
47 | # self._set_test_item('drag_stop_3', (-.77, -.57)) | |
48 | # self._set_test_item('drag_start_3', (-.28, -.85)) | |
49 | # self._set_test_item('drag_stop_4', (-.42, -.85)) | |
067a36db | 50 | |
10262fde FC |
51 | def _instr_txt(self): |
52 | txt = _('Scene: ') + self.name() + '\n\n' | |
53 | txt += _('Goal: every domino piece must be hit\n\n') | |
54 | txt += _('keep \5mouse_l\5 pressed to drag an item\n\n' | |
55 | 'keep \5mouse_r\5 pressed to rotate an item') | |
56 | return txt | |
57 | ||
58 | def _win_condition(self): | |
59 | return all(itm.strategy.win_condition() for itm in self.items) and not self._paused |