Commit | Line | Data |
---|---|---|
b35b1f62 FC |
1 | from logics.scene import Scene |
2 | from logics.items.box import Box, HitStrategy | |
3 | from logics.items.shelf import Shelf | |
4 | from logics.items.domino import Domino | |
5 | from logics.items.basketball import Basketball | |
6 | from logics.items.teetertooter import TeeterTooter | |
8c9bf90e FC |
7 | |
8 | ||
9 | class SceneBox(Scene): | |
10 | ||
11 | @staticmethod | |
12 | def name(): | |
13 | return _('Box') | |
0eff64a3 FC |
14 | |
15 | def _set_items(self): | |
16 | self.items = [] | |
9fc7f6fb | 17 | self.items += [Box(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)] |
0eff64a3 | 18 | #self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)] |
9fc7f6fb FC |
19 | self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(.46, 0, -3.95))] |
20 | 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))] | |
21 | 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)] | |
22 | 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)] | |
32cd89ca | 23 | 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)] |
0e86689f FC |
24 | self.items += [Box(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(4.38, 0, -3.35))] |
25 | self.items[-1].set_strategy(HitStrategy(self.items[-2], self.items[-1].node, self.items[-1]._world)) | |
9fc7f6fb FC |
26 | #self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=2)] |
27 | #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)] | |
28 | #self.items += [TargetDomino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(-.49, 0, -.04), tgt_degrees=60)] | |
29 | #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)] | |
30 | #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)] | |
31 | #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)] | |
0eff64a3 FC |
32 | #self.items += [Basketball(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)] |
33 | #self.items += [TeeterTooter(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)] | |
34 | ||
35 | def _instr_txt(self): | |
36 | txt = _('Scene: ') + self.name() + '\n\n' | |
0afaa72e | 37 | txt += _('Goal: the left box must hit the right box\n\n') |
0eff64a3 FC |
38 | txt += _('keep \5mouse_l\5 pressed to drag an item\n\n' |
39 | 'keep \5mouse_r\5 pressed to rotate an item') | |
40 | return txt | |
0e86689f | 41 | |
0a0994e4 FC |
42 | def _win_condition(self): |
43 | return all(itm.strategy.win_condition() for itm in self.items) and not self._paused |