ya2 · news · projects · code · about

end frame
[pmachines.git] / pmachines / scenes / scene_domino.py
1 from pmachines.scene import Scene
2 from pmachines.items.box import Box
3 from pmachines.items.shelf import Shelf
4 from pmachines.items.domino import Domino, TargetDomino
5 from pmachines.items.basketball import Basketball
6 from pmachines.items.teetertooter import TeeterTooter
7
8
9 class SceneDomino(Scene):
10
11 sorting = 0
12
13 @staticmethod
14 def name():
15 return _('Domino')
16
17 def _set_items(self):
18 self.items = []
19 #self.items += [Box(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
20 #self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
21 self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(-1.2, 0, -.6))]
22 self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(1.2, 0, -.6))]
23 self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=2)]
24 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)]
25 self.items += [TargetDomino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, pos=(-.49, 0, -.04), tgt_degrees=60)]
26 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)]
27 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)]
28 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)]
29 #self.items += [Basketball(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
30 #self.items += [TeeterTooter(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
31
32 def _instr_txt(self):
33 txt = _('Scene: ') + self.name() + '\n\n'
34 txt += _('keep \5mouse_l\5 pressed to drag an item\n\n'
35 'keep \5mouse_r\5 pressed to rotate an item')
36 return txt