+from pmachines.scene import Scene
+from pmachines.items.box import Box
+from pmachines.items.shelf import Shelf
+from pmachines.items.domino import Domino, UpStrategy, DownStrategy
+from pmachines.items.basketball import Basketball
+from pmachines.items.teetertooter import TeeterTooter
+
+
+class SceneTeeterTooter(Scene):
+
+ sorting = 5
+
+ @staticmethod
+ def name():
+ return _('Teeter tooter')
+
+ def _set_items(self):
+ self.items = []
+ self.items += [Box(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=3, count=1, friction=1)]
+ #self.items += [TeeterTooter(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=5, count=2)]
+ self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(-2.76, 0, -1.45))]
+ self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(-.56, 0, -1.45))]
+ self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(2.27, 0, -.28))]
+ self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(4.38, 0, -.28))]
+ 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))]
+ 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))]
+ self.items += [TeeterTooter(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(-2.74, 0, -1.20))]
+ self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=1, r=-25.30, friction=1, pos=(-2.78, 0, -.93))]
+ self.items += [Box(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=.2, friction=1, model_scale=.5, pos=(-3.61, 0, -.99), r=-25.30)]
+ self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(-.25, 0, -.57), r=52)]
+ self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(1.73, 0, -.89))]
+ self.items[-1].set_strategy(DownStrategy(self.items[-1]._np, 35))
+ self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(2.57, 0, -.89))]
+ self.items[-1].set_strategy(DownStrategy(self.items[-1]._np, 35))
+ self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(3.50, 0, -.89))]
+ self.items[-1].set_strategy(DownStrategy(self.items[-1]._np, 35))
+ #self.items += [Basketball(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
+ #self.items += [TeeterTooter(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
+
+ def _instr_txt(self):
+ txt = _('Scene: ') + self.name() + '\n\n'
+ txt += _('Goal: you must hit every domino piece\n\n')
+ txt += _('keep \5mouse_l\5 pressed to drag an item\n\n'
+ 'keep \5mouse_r\5 pressed to rotate an item')
+ return txt
+
+ def _win_condition(self):
+ return all(itm.strategy.win_condition() for itm in self.items) and not self._paused