1 from game
.scene
import Scene
2 from game
.items
.box
import Box
3 from game
.items
.shelf
import Shelf
4 from game
.items
.domino
import Domino
, DownStrategy
5 from game
.items
.basketball
import Basketball
6 from game
.items
.teetertooter
import TeeterTooter
9 class SceneDomino(Scene
):
17 #self.items += [Box(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
18 #self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
19 self
.items
+= [Shelf(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, mass
=0, pos
=(-1.2, 0, -.6))]
20 self
.items
+= [Shelf(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, mass
=0, pos
=(1.2, 0, -.6))]
21 self
.items
+= [Domino(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, count
=2)]
22 self
.items
+= [Domino(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(-1.14, 0, -.04))]
23 self
.items
[-1].set_strategy(DownStrategy(self
.items
[-1]._np
, 60))
24 self
.items
+= [Domino(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(-.49, 0, -.04))]
25 self
.items
[-1].set_strategy(DownStrategy(self
.items
[-1]._np
, 60))
26 self
.items
+= [Domino(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(0.94, 0, -.04))]
27 self
.items
[-1].set_strategy(DownStrategy(self
.items
[-1]._np
, 60))
28 self
.items
+= [Domino(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(1.55, 0, -.04))]
29 self
.items
[-1].set_strategy(DownStrategy(self
.items
[-1]._np
, 60))
30 self
.items
+= [Domino(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(2.09, 0, -.04))]
31 self
.items
[-1].set_strategy(DownStrategy(self
.items
[-1]._np
, 88))
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)]
36 txt
= _('Scene: ') + self
.name() + '\n\n'
37 txt
+= _('Goal: every domino piece must fall\n\n')
38 txt
+= _('keep \5mouse_l\5 pressed to drag an item\n\n'
39 'keep \5mouse_r\5 pressed to rotate an item')
42 def _win_condition(self
):
43 return all(itm
.strategy
.win_condition() for itm
in self
.items
) and not self
._paused