ya2 · news · projects · code · about

abstract test positions in world units
[pmachines.git] / pmachines / scenes / scene_domino.py
index 086511a7a484e1a0dc54afb155f127c03b837e27..e5a65ba206608e0836703e619a217e686117bbf3 100644 (file)
@@ -1,9 +1,11 @@
+from panda3d.core import NodePath
 from pmachines.scene import Scene
 from pmachines.items.box import Box
 from pmachines.items.shelf import Shelf
 from pmachines.items.domino import Domino, DownStrategy
 from pmachines.items.basketball import Basketball
 from pmachines.items.teetertooter import TeeterTooter
+from ya2.p3d.gfx import P3dGfxMgr
 
 
 class SceneDomino(Scene):
@@ -13,7 +15,6 @@ class SceneDomino(Scene):
         return _('Domino')
 
     def _set_items(self):
-        self.items = []
         #self.items += [Box(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
         #self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, count=3)]
         self.items += [Shelf(self._world, self._mouse_plane_node, self.cb_inst, self.current_bottom, self.repos, mass=0, pos=(-1.2, 0, -.6))]
@@ -32,6 +33,14 @@ class SceneDomino(Scene):
         #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 _define_test_items(self):
+        self._pos_mgr.register('drag_start_0', (35, 60))
+        self._set_test_item('drag_stop_0', (-1.82, .06))
+        self._set_test_item('drag_stop_1', (.49, .06))
+        self._set_test_item('drag_stop_2', (-1.54, .06))
+        self._set_test_item('drag_start_1', (-1.54, .4))
+        self._set_test_item('drag_stop_3', (-1.05, .4))
+
     def _instr_txt(self):
         txt = _('Scene: ') + self.name() + '\n\n'
         txt += _('Goal: every domino piece must fall\n\n')