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
, UpStrategy
, DownStrategy
5 from game
.items
.basketball
import Basketball
6 from game
.items
.teetertooter
import TeeterTooter
9 class SceneDominoBoxBasketball(Scene
):
13 return _('Domino, box and basket ball')
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))]
23 #self.items += [Domino(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=9)]
24 self
.items
+= [Domino(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(1.68, 0, -.89))]
25 self
.items
[-1].set_strategy(DownStrategy(self
.items
[-1]._np
, 35))
26 self
.items
+= [Domino(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(2.35, 0, -.89))]
27 self
.items
[-1].set_strategy(DownStrategy(self
.items
[-1]._np
, 35))
28 self
.items
+= [Domino(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(3.08, 0, -.89))]
29 self
.items
[-1].set_strategy(DownStrategy(self
.items
[-1]._np
, 35))
30 self
.items
+= [Domino(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(3.78, 0, -.89))]
31 self
.items
[-1].set_strategy(DownStrategy(self
.items
[-1]._np
, 35))
32 self
.items
+= [Domino(self
._world
, self
._mouse
_plane
_node
, self
.cb_inst
, self
.current_bottom
, self
.repos
, pos
=(4.53, 0, -.89))]
33 self
.items
[-1].set_strategy(DownStrategy(self
.items
[-1]._np
, 35))
34 #self.items += [Basketball(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
35 #self.items += [TeeterTooter(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
38 txt
= _('Scene: ') + self
.name() + '\n\n'
39 txt
+= _('Goal: every domino piece must be hit\n\n')
40 txt
+= _('keep \5mouse_l\5 pressed to drag an item\n\n'
41 'keep \5mouse_r\5 pressed to rotate an item')
44 def _win_condition(self
):
45 return all(itm
.strategy
.win_condition() for itm
in self
.items
) and not self
._paused